Jump to content

Gary Griswold

Video Fails on iOS, but succeeds on emulator

Moderator Tag

Recommended Posts



I have written a very basic class using the VideoLoader for a mobile application in AS3 (not Flex), and it works very well when I run it in the emulator.  But, when I run it on the device, it fails with a NetStream.Play.Failed error.  I am pretty new to video, any idea what could be wrong.  The code, and a log of errors follows.


package lib.view.student {

import com.greensock.events.LoaderEvent;
import com.greensock.loading.VideoLoader;
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.getTimer;

public class VideoPlayerGS extends Sprite {

private var _sourceURL:String;
private var _video:VideoLoader;

public function VideoPlayerGS(sourceURL:String) {
_sourceURL = sourceURL;
trace('VIDEO URL', _sourceURL);
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
private function addedToStageHandler(event:Event) : void {
_video = new VideoLoader(_sourceURL,
{autoPlay: true,
container: this,
width: stage.fullScreenWidth,
height: stage.fullScreenHeight,
scaleMode: 'proportionalInside',
hAlign: 'center',
vAlign: 'center',
bgColor: 0x000000,
onOpen: onOpenHandler,
onInit: onInitHandler,
onProgress: onProgressHandler,
onComplete: onCompleteHandler,
onCancel: onCancelHandler,
onError: onErrorHandler,
onFail: onFailHandler,
onIOError: onIOErrorHandler

private function onOpenHandler(event:LoaderEvent) : void {
trace('LoaderEvent', event.type, event.text, getTimer());
private function onInitHandler(event:Event) : void {
trace('InitEvent', event.type, getTimer());
private function onProgressHandler(event:LoaderEvent) : void {
//trace('ProgressEvent', event.toString(), getTimer());
private function onCompleteHandler(event:LoaderEvent) : void {
trace('CompleteEvent', event.type, event.text, getTimer());
private function onCancelHandler(event:LoaderEvent) : void {
trace('CancelEvent', event.type, event.text, getTimer());
private function onErrorHandler(event:LoaderEvent) : void {
trace('ErrorEvent', event.type, event.text, getTimer());
private function onFailHandler(event:LoaderEvent) : void {
trace('FailEvent', event.type, event.text, getTimer());
private function onIOErrorHandler(event:LoaderEvent) : void {
trace('IOErrorEvent', event.type, event.text, getTimer());


The console output is as follows:


[trace] VIDEO URL http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v

[trace] LoaderEvent open  2514

[trace] InitEvent init 2952

[trace] ----

[trace] Error on VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v): NetStream.Play.Failed

[trace] ----

[trace] ErrorEvent error VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v) > NetStream.Play.Failed 2979

[trace] FailEvent fail VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v) > NetStream.Play.Failed 2980

[trace] CancelEvent cancel  2980

Link to comment
Share on other sites

Hi Gary,


Sorry to hear about your trouble.

Seems f4v files are quite problematic on iOS: https://www.google.com/search?q=f4v+video+ios&oq=f4v+video+ios&aqs=chrome..69i57.18982j0j4&sourceid=chrome&es_sm=91&ie=UTF-8, but frankly, I'm no expert myself.


Also, LoaderMax and its sub-loaders were designed for use in web-based apps delivered via Flash Player.

Unfortunately, there are far too many changes / bugs (related to loading) in various versions of AIR for us to keep up with.

You might want to poke around the adobe AIR forums and see how folks handle these issues.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.