apache-flexvideoflash-builderflex-mobileosmf

MP4 video remains hidden on mobile Flex app


I'm currently struggling on my Flex mobile project using video player. Basically, the problem is that I don't seem to be able to play, or at least see, .MP4 videos at all (no video, no sound, the player view is simply empty) on a iOS mobile device. As soon as I replace the source with a .FLV video, everything is working perfectly.

I have tried two approaches, even though they are using the same components underneath from what I've understood.

Both gave me the same result: the video appears and is played correctly as long as I'm using .FLV, I can't see/hear anything as soon as I'm loading a .MP4 video instead And of course, MP4 is the format I want to use for this project. I might add that I'm using H.264 codec for these .MP4 files.

Is there anything I'm doing wrong?

Note that both formats are working as long as I'm using the emulator, the .MP4 issue is only occurring when I deploy the app on my iPad.

This is a mobile Flex 4.6 project, using AIR 3.9 on Flash Builder 4.7 for Windows 7 Pro


Solution

  • H.264 video is not supported on iOS devices with RTMP, and I've not seen it work without using the HTTP Live Streaming protocol. Here's a section from the ActionScript reference for NetStream.play:

    Special considerations for H.264 video in AIR 3.0 for iOS

    For H.264 video, the iOS APIs for video playback accept only a URL to a file or
    stream. You cannot pass in a buffer of H264 video data to be decoded. Depending
    on your video source, pass the appropriate argument to NetStream.play() as
    follows:   
    
    - For progressive playback: Pass the URL of the file (local or remote).
    
    - For streaming video: Pass the URL of a playlist in Apple's HTTP Live Streaming
    (HLS) format. This file can be hosted by any server; Flash Media Server 4.5 and
    higher has the advantage of being able to encode streams in HLS format.