Skip to main content
Participant
July 18, 2011
Question

Loading local flv on iPad

  • July 18, 2011
  • 2 replies
  • 1796 views

I have published an AIR app for iOS but am having trouble loading and playing a video file (flv container) locally from the applicationDirectory. I can load it fine from a server, but when i include it into the ipa and try to load from its path relative to the applicationDirectory (or applicationStorageDirectory for that matter) it does not load.

Any ideas why..? Code below for creating the filepath, the video loads via  netconnection/netstream

var path:String = File.applicationDirectory.resolvePath("video/Clusta_Reel.flv").url;

loadNewVideo(path);

Thanks

This topic has been closed for replies.

2 replies

relaxatraja
Inspiring
July 19, 2011

Try with:

loadNewVideo("video/Clusta_Reel.flv");

you have flvcomponent within your stage?

Participant
July 19, 2011

I have it loading an flv now from a local location and without using the StageWebView (so i can add custom controls).

I didn't need to load it from a local file-system path (applicationDirectory etc) it loads fine from a relative path, however - because i am publishing the ipa file using a batch file and the AIR SDK/java compiler i needed to change the video's location to bin/video/Clusta_Reel.flv  (even though the swf was in the bin folder, the packager was in the parent folder)

I now have an h264 encoded flv playing back locally, on an iPad 1, published using AIR 2.7 and the playback is great - no jerkiness etc. I think the engineers have sorted the video playback issues on 2.7!

Thanks for your help

Sean

Participant
July 18, 2011

The video is encoded in h264 by the way. It all loads fine when loading from a remote location (same file) so i'm assuming it's something to do with the iOS file-system, or they have it locked down when trying to load flv files locally for some reason?

Participating Frequently
July 18, 2011

Hi,

I cannot test as my FB trial expired but as I remember that's encoding topic:

http://forums.adobe.com/thread/857772

So use StageWebView for your FLV - unless you re-encode them into other format,

(if you would use StageWebView then: 1) use .url as well 2) it has to have "stage" property assigned before using it - just after contructor - otherwise it will crash [that's a bug in Air])

hth,

regards,

Peter