Detect if the video is loaded

Hello

I want to detect each time the video is loaded

because I display a png of the first frame of the video, when the video starts to play I want to delete the image, try to make a smooth effect

Here is my code to load the video

var netLoader:NetLoader = new NetLoader();
var resource = new URLResource (url)
var metadata:Metadata = new Metadata();

metadata.addValue (CaptioningPluginInfo.CAPTIONING_METADATA_KEY_URI, CAPTION_URL);
resource.addMetadataValue (CaptioningPluginInfo.CAPTIONING_METADATA_NAMESPACE, metadata);
mediaFactory.addItem (new MediaFactoryItem ("org.osmf.elements.video", netLoader.canHandleResource, createVideoElement));
mediaElement = mediaFactory.createMediaElement (resource);

I do not know where to add the listener to know if the video is ready

Thanks for your help

I believe that you also use a MediaPlayer instance and it is the object you need to listen to his

the MediaPlayerStateChangeEvent mediaPlayerStateChange

The values of the State of the player can be found at PlayState.as.

-Zhang Wei

Senior computer scientist

Adobe Systems, Inc..

[email protected]

Tags: Adobe Open Source

Similar Questions

  • How to control the video swf loaded in the loading component?

    I have an external swf file loaded into the loading component. The external swf loaded into the component loading stops at departure. I want to play by a button outside the loading component that is located in the main swf movie. CAN SOMEONE HELP ME CONTROL THE VIDEO SWF LOADED INTO THE COMPONENT OF LOADING EXTERNAL?

    You can target the SWF via the content property of the UILoader.  If the name of the instance the UILoader is ldr...

    MovieClip (ldr.content) .play ();

  • Regarding the videos and loading times

    Hello community!

    Currently, I transfer my course on a Moodle platform.

    I use a lively teacher of Minister content and interact with my students.

    That the character is and flv. video. The thing is, sometimes when when my students

    Look at their online courses, they experience some problems such as delays with the videos.

    -J' noticed that when I publish my project, Captivate creates a zip with all the

    videos in it. My students acess the html file to open it. Is it possible to publish a single file, so that students are forced to download the holes (including videos)

    beforehand? They will have to wait for it and would not experience what seems to be a problem of streaming...

    -Are there same solution or if you guys could share with me?

    -J' also thought that it could have something to do with the features of moodle, so if a person thinks that please let me know.

    Sorry for any lack of communication and thanks in advance!

    Your problem is probably due to your not having students do not excellent bandwidth to display the content.

    You can try setting your preloader to 100% so that all the content of the course is downloaded before playback starts.  But maybe it's not a perfect solution.

  • How how to videos from youtube for better play and not load all few seconds? The video clip load and only play for two seconds and starts charging again.

    I have a toshiba laptop satellite 655.

    I have a toshiba laptop satellite 655.

    Hello

    If a YouTube video is slow to the buffering, which is a network related issue and not a system issue. See the article on reading problems: http://support.google.com/youtube/bin/answer.py?hl=en&answer=74662

    Kind regards

    Patrick

  • How to make so that the button to show what video showing / loading

    I have a homepage with a video background and a button that returns the user to another page.

    I just have a problem, and it is when you see the page online for a split of a second, you see only the button on a black background before the video is loaded and begins to play. Not really how to on this subject... I recon the button must be visible when the video is displayed or are charged... ?

    I have the following. 'Mybtn' is my button.

    videos of the var: Array = new Array("videos/video.flv");

    Stop();

    stage.scaleMode = StageScaleMode.NO_SCALE;

    internship. Align = StageAlign.TOP_LEFT;

    stage.addEventListener (Event.RESIZE, position);

    BG.video.addEventListener (ProgressEvent.PROGRESS, function() {removeChild (preloader) ;});

    BG.video.addEventListener (Event.COMPLETE, function (e) {BG.video.play ;});)

    BG.video.source = videos [Math.floor (Math.random () * videos.length)];

    BG.video.getVideoPlayer (BG.video.activeVideoPlayerIndex) .smoothing = true;

    position (Event);

    function position (Event): void {}

    var SH = stage.stageHeight;

    var SW = stage.stageWidth;

    var SF = (BG.width)/(BG.height);

    var SS = (SW) / (SH);

    BG.x = SW/2;

    BG.y = HS/2;

    BG.video.x=-BG.video.width/2;

    BG.video.y=-BG.video.height/2;

    If (SS > SF) {}

    BG.width = (SW);

    BG.height = /SF (SW);

    } else {}

    BG.width = (HS) * SF;

    BG.height = (SH);

    }

    Mybtn

    Mybtn.x = SW/2;

    Mybtn.y = HS/2;

    Mybtn.buttonMode = true

    }

    Mybtn.addEventListener (MouseEvent.CLICK, MinFunktion);

    function MinFunktion (Event): void {}

    navigateToURL (new URLRequest ("index3.html"));

    BG.video.stop)

    Mybtn.gotoAndStop (68)

    trace ("you pushed Mybtn");

    }

    use:

    Import fl.video.VideoEvent;

    Mybtn.Visible = false;

    videos of the var: Array = new Array("videos/video.flv");

    Stop();

    stage.scaleMode = StageScaleMode.NO_SCALE;

    internship. Align = StageAlign.TOP_LEFT;

    stage.addEventListener (Event.RESIZE, position);

    BG.video.addEventListener (VideoEvent.READY, readyF);

    BG.video.addEventListener (ProgressEvent.PROGRESS, function() {removeChild (preloader) ;});

    BG.video.addEventListener (Event.COMPLETE, function (e) {BG.video.play ;});)

    BG.video.source = videos [Math.floor (Math.random () * videos.length)];

    BG.video.getVideoPlayer (BG.video.activeVideoPlayerIndex) .smoothing = true;

    position (null);

    function readyF(e:Event):void {}

    Mybtn.Visible = true;

    }

    function position(e:Event):void {/ /}<-you had="" a="" typo="">

    var SH = stage.stageHeight;

    var SW = stage.stageWidth;

    var SF = (BG.width)/(BG.height);

    var SS = (SW) / (SH);

    BG.x = SW/2;

    BG.y = HS/2;

    BG.video.x=-BG.video.width/2;

    BG.video.y=-BG.video.height/2;

    If (SS > SF) {}

    BG.width = (SW);

    BG.height = /SF (SW);

    } else {}

    BG.width = (HS) * SF;

    BG.height = (SH);

    }

    Mybtn

    Mybtn.x = SW/2;

    Mybtn.y = HS/2;

    Mybtn.buttonMode = true

    }

    Mybtn.addEventListener (MouseEvent.CLICK, MinFunktion);

    function MinFunktion (Event): void {}

    navigateToURL (new URLRequest ("index3.html"));

    BG.video.stop)

    Mybtn.gotoAndStop (68)

    trace ("you pushed Mybtn");

    }

  • Published the video of the InDesign file streaming does not correctly

    I joined a MP4 which is 7 mb in size in my InDesign document. In playback mode, after using 'Post online', the feature is good [goes to fullscreen etc], but the video is extremely slow to load. So slow that it is very bad. It is not the internet connection because it's testing of a variety of regions where the problem is for the video to load poorly. Any suggestions on video content or the way I'm integrating the video will be appreciated. Any suggestions will be appreciated at all actually!

    You push the limits on the size of the videos.

    Publish online FAQ

    "But if you want an optimum read the experience of online Documents publishing we recommend that you encode your videos to mp4 files and keep quite small."

  • Connection for the video after the publication error

    Hello

    I have a problem with Captivate 6.0, I insert a video FLV in a project with multiple synchronized slides. This video is the beginning as an opener. It is only on this one slide, had not been extended across from all others. I have tried and found and replaced the 2 files found in lib to 9.0 and 10.0 and still not working after this fix. Is it something I am doing wrong? It worked on my latest project a month ago. Y at - it a patch coming out? Or not?...

    Thank you

    Appreciate the help!

    Hi all

    Thanks Anjaneai, we were able to solve the problem, the problem that I had set in forcing changes to validate when editing, for some reason, that he did not publish any changes made with the video was loading an incorrect video. I have also published in the default folder that goes to no to seduce while doing this, it seemed to work. I hope that our helicopter a fix is able to help someone else. To ensure it please read through this forum and do everything everyone has gotten me to can solve your problem as it did mine.

    Thanks for all your help!

    He appreciates!

    blewis

  • I need to make a menu open once the video finished playing

    I use AS3 becase it is the only way that I could understand how make a video play and stop with the buttons. I'm not married to the use of AS3. Basically what I want to do is make a video player that is very similar to that used on youtube. I want a video to play (video introduction to my Web site), and then at the end, a menu will appear to give links to other pages and other videos. I want to have a link on the video that will take you directly to the menu where you have seen the video and I want to just display the links or anything that is in the menu.

    So in order: video play when he visited the site, the video ends, meny appears give links

    A link to skip video and go directly to the menu

    link in the menu to return to the video

    Lets continue with AS3 since you already have some built.

    You should use the VideoEvents class to detect when the video finishes playing.

    myVideoPlayer.addEventListener (VideoEvent.COMPLETE, doCompleteVideo);

    function doCompleteVideo(evt:*):void {}
    myVideoPlayer.stop ();
    doDisplayMenu();
    }

    function doDisplayMenu (): void {}
    Place the shares here to display the menu
    }

    The COMPLETE event fires when the video finishes playing.

    Place a link is as simple as placing a button on the stage, in a layer above the video player, so we always see it giving it an instance name and using the following code:

    myButton.addEventListener (MouseEvent.PRESS, doCompleteVideo);

    This will trigger the function complete video, stop the video and view the menu.

  • I can't view the videos from the loading of FIREFOX. WHY?

    After the conversion from IE to Mozilla Firefox, I lost the ability to view the videos. I get frequently URLs to access videos from You Tube or other on line videos. Since migrating to Firefox, they will not load. Just today, I downloaded Adobe Flash Player, but I still can't watch videos.

    First thing that comes to mind is one of your extensions, particularly GreatArcadeHits. To do a search on it, I stumbled on this from botcrawl.com:

    The GreatArcadeHits virus (also found that the virus of the great Arcade Hits; although not technically a virus) is a potentially unwanted program or combination of qualified of adware, malware and spyware which mainly installs computer systems with or without consent alongside software downloaded from download.com browser hijacker and monetized other freeware and shareware distribution sites.

    So, you want to uninstall that permanently your extensions. Go to Firefox button/File > Add-Ons/Extensions then uninstall GreatArcadeHits.

    Also, go to your control panel, Instructions in XP:
    Start > Control Panel > Classic view > Add/Remove programs and check to see if GreatArcadeHits is there. If this is the case, you can uninstall it.

    One last thing, you want to scan your computer for viruses. You can try these free programs to search for malicious software that work with your existing anti-virus software:

    Microsoft Security Essentials is a good permanent antivirus for Windows 7/Vista/XP, if you do not already have one.

    More information can be found in the article troubleshooting Firefox problems caused by malware .

    This solve your problems? Please report to us!

  • I can't load the video on any site with Firefox.

    In the last days, I was not able to load any video at all from any site. First of all, the video appears as a black box, then becomes a white box as if nothing is there yet, and my cursor continuously freaks out.

    I made a video of the issue by using a screen capture program-
    http://www.YouTube.com/watch?v=7bQ03hbty-s

    I tried the following things with no results-
    Launch FireFox in Mode safe
    Disable all addons / extensions / themes.
    Load of FireFox profiles
    Disable hardware acceleration
    Uninstall / reinstall Firefox
    Analyses of virus/Malware/Spyware
    Update Flash / Java

    I can load videos in all my browsers (Internet Explorer, Google Chrome and Opera), with no problem at all. It's heartbreaking, because I am a strong supporter and advocate of Mozilla Firefox and a user since 2.0, and it's the first big question I had.

    You said that you have updated to flash, but have you tried to uninstall completely and then return a version where you were?

    Try making sure no flash process or firefox processes are running in the background as well. You can have some locked files also: you have restarted your computer completely?

  • The AirPlay video just loading and does not.

    I have an Apple TV 4th Gen with OS 9.2. Whenever I try to airplay, a video of safari or chrome it just load. No difficulty for thi

    I had this experience, and my dose is briefly turn AirPlay and turn it back on to my iPad. Makes work normally. You may also need to hit Play If the video loads stopped.

  • Gel prior to loading of the video from YouTube

    When I go on youtube and search for a video and click on a link, it loads the video, but first it freezes for about 10-15 seconds, and the video window flash does not load correctly. I have to move the mouse over the various buttons in the field of the video to make them appear.

    Before that happened, I had an opinion on something to go wrong with a script, I didn't really and I chose to continue executing the script and do not display the new dialog box! I don't know how to cancel this option. How can I do this?

    Also, I tried to start FF in safe mode and try to do the same thing on YouTube, and she continues to do the same thing. What should I do to fix this?

    Try to opt-out of HTML5 on YouTube video.

    (Bug 775491 - script errors is not liable for HTML5 on YouTube)

  • After upgrade FF I couldn't watch the video on Youtube. Event I down load Adobe flash player as required. I can still see Adobe flash plugin in FF.

    After upgrade FF I couldn't watch the video on Youtube. Event I down load Adobe flash player as required. I can still see Adobe flash plugin in FF.

    This screenshot shows all of these plugins as being (disabled) and "grey" - click on the button Activate on the right side.

  • My Satellite P300 forget sometimes load the video driver

    My laptop (Satellite P300) sometimes "forget" to start to load the videodriver.
    If the resolution is by default in the Windows startup screen.
    No matter what version of Windows I have, all the drivers are up to date.

    When I restart for the most part, the problem is solved...

    To be honest I never heard of something like that. in recent years, my brother has P300. In the beginning he used with original Vista and 2 years its P300 works with Win7. No problem at all.

    I don't know which OS you are using now, but have you tried reinstalling the video driver (display)?
    I also hope that you are using driver on Toshiba download page.

  • Videos YouTube loads but after 2-4 s, the area of the drive gets white with ivory white... Help

    Videos YouTube loads but after 2-4 s, the area of the drive gets white with ivory white...

    This has happened

    Each time Firefox opened

    See: http://support.mozilla.com/en-US/kb/Check+for+Updates+is+disabled

Maybe you are looking for