Stop video loading - is it possible?

Hi all.

I did a player web, based on the OSMF framework. Initially, it loads a standard quality video - but the user can then choose get a larger version of the video, using a 'resolution of the switch' - button.

The problem is that, during the switch, the player continues the clip low resolution - and vice versa. As you can see in the code, I tried different approaches to solve this problem.


So: I need to force the movie to stop loading - and preferably without forcing the player to load. Is this possible?

Here is the code that takes care of the video:

public void loadVideo (theURL) {}
trace ("load video" + theURL);
If (mediaContainer) {}
mediaPlayer.stop ();
videoplaceholder.removeChild (mediaContainer);
mediaContainer.removeMediaElement (currentMediaElement);
mediaFactory.removeItem (mediaElement);
mediaPlayer.media = undefined;
}

mediaPlayer = new MediaPlayer();
NAR view' and bliver tilgaengeligt, send da event
mediaPlayer.addEventListener (MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE, onViewable);
mediaElement = mediaFactory.createMediaElement (new URLResource (theURL));

layout = new LayoutMetadata();
Layout.Width = playerdimensions [0];
Layout.Height = playerdimensions [1];

If (! scrubber) {}
addScrubberAndStuff();
}

mediaPlayer.addEventListener (DisplayObjectEvent.MEDIA_SIZE_CHANGE, onDimensionsChange);
mediaPlayer.addEventListener (TimeEvent.CURRENT_TIME_CHANGE, onCurrentTimeChange);
mediaPlayer.addEventListener (TimeEvent.COMPLETE, videoHasEnded);
mediaPlayer.media = mediaElement;

}

Best regards

Anders

Okay, it looks like you will create a second instance of MediaPlayer is called the second time loadVideo().  I advise to use a single instance of MediaPlayer, no matter how many different loaded videos.  The loadVideo() method only needs to create the appropriate MediaElement and assign it to MediaPlayer (as well as add it to MediaContainer).

Tags: Adobe Open Source

Similar Questions

  • Need to flv video to stop once loaded

    Hi, I created a document that has 3 buttons. When everyone is pressed action happens... loads a movie, jumps to the next section, plays the video. The problem I have is when I click on the button image, my video playback and stays. The film should play only when the movie button is selected, and then deleted when you press another.

    It may be possible to indicate to the video controller to stop once loaded, but I do not know the command. The way the movie is imported, the controllers are integrated in the wrapper, but I don't know how to stop playback of the movie.

    Any ideas? As much detail as poss please! My film is called movie.flv, but the instance is called vid.

    < CODE >

    package {}
    import flash.display. *;
    import flash.events. *;

    import local classes the MyClasses folder MyClasses.*;//Import

    /*
    This application displays 3 different ways to show the video and animation. The video must be included in the scene by importing
    By clicking on the buttons at the bottom brings to the top of each type of object. All have their own actionscipt classes to control.
    If you have imported a video placed on the stage and gave him the name of the vid, then you can uncomment the video code
    */

    SerializableAttribute public class VideoMain extends Sprite {}

    Create objects, we can use with actionscript. These are related to the symbols of the library.
    Each has its own actionscript file to control internal...
    private var banner: AnimationBanner = new AnimationBanner();
    private var frames: AnimationFrames = new AnimationFrames();

    public void VideoMain() {//This code is executed at the start of our application. It has the same name as the flash file...
    //
    addChild (banner);
    addChild (frames);
    The value that they are invisible...
    Banner.Visible = false;
    frames. Visible = false;

    Set up actions for the buttons at the bottom of the screen...
    banner_btn.addEventListener (MouseEvent.CLICK, showBanner);
    frames_btn.addEventListener (MouseEvent.CLICK, showFrames);

    Cannot refer to vid if you imported a component video and called it "vid".
    VID. Visible = false;
    vid.addEventListener (MouseEvent.CLICK, showVid);
    }

    The (event: MouseEvent) means that the function will only work if it is called by a mouse event (in this case, the user clicks on the mouse)
    private void showBanner(event:MouseEvent):void {}
    Banner.Visible = true;
    frames. Visible = false;
    VID. Visible = false;
    movie_flv. Stop();
    }

    private void showFrames(event:MouseEvent):void {}
    Banner.Visible = false;
    frames. Visible = true;
    VID. Visible = true ;);
    movie_flv. Stop();
    }

    private void showVid(event:MouseEvent):void {}
    Banner.Visible = false;
    frames. Visible = false;
    VID. Visible = true;
    movie_flv. Stop();
    }

    }

    }

    < code >

    use:

    package  {
    import flash.display.*;
    import flash.events.*;

    import MyClasses.*;//Import local classes from MyClasses folder

    /*
    This app shows 3 different ways of showing video and animation. The video must be brought into the stage by importing it
    Clicking the buttons at the bottom brings up each type of object. The all have their own actionscipt classes to control them.
    If you have imported a video, placed it on the stage and given it the name vid, then you can uncomment the video code
    */

    public class VideoMain extends Sprite{
     
      //Create objects we can use with actionscript. These are linked to symbols in the library.
      //Each has its own actionscript file to control it internally...
      private var banner:AnimationBanner = new AnimationBanner();
      private var frames:AnimationFrames = new AnimationFrames();

    public function VideoMain() {//This code is run when our application starts. It has the same name as the flash file...
       //
       addChild(banner);
       addChild(frames);
       //Set them to be invisible...
       banner.visible = false;
       frames.visible = false;
      


    Set up actions for the buttons at the bottom of the screen...
    banner_btn.addEventListener (MouseEvent.CLICK, showBanner);
    frames_btn.addEventListener (MouseEvent.CLICK, showFrames);
      
    Cannot refer to vid if you imported a component video and called it "vid".
    VID. Visible = false;
    vid.addEventListener (MouseEvent.CLICK, showVid);

    movie_flv.addEventListener (Event.REMOVED_FROM_STAGE, removedF);  assuming that movie_flv is a flvplayback component existing at this stage.

    }
     
    The (event: MouseEvent) means that the function will only work if it is called by a mouse event (in this case, the user clicks on the mouse)
    private void showBanner(event:MouseEvent):void {}
    Banner.Visible = true;
    frames. Visible = false;
    VID. Visible = false;
    movie_flv. Stop();
    }
    function removedF(e:Event):void {}

    movie_flv. Stop();

    }
    private void showFrames(event:MouseEvent):void {}
    Banner.Visible = false;
    frames. Visible = true;
    VID. Visible = true ;);
    movie_flv. Stop();
    }
     
    private void showVid(event:MouseEvent):void {}
    Banner.Visible = false;
    frames. Visible = false;
    VID. Visible = true;
    movie_flv. Stop();
    }

    }

    }

  • integrated load several times to stop video

    Hello

    just started using on board animate. I have some experience with Flash and After Effect for the layout is quite familiar to me. I have no background in coding, so I'm very happy that it generates codes for me.

    My goal is to make a website simple html5 with links / videos to my content integrated (500 and vimeo). I copied some codes used for the coating of Youtube, sub'd the url by url from vimeo, and it worked fine. I used a "video game" button on the main page to start loading the video page (see my code below).

    It worked fine the first time I clicked on the button and went to the video page. However, on his return to the home page, click on the button 'play video' even once, a copy of the video is loaded just below the video loaded from the first click. This happens for as many times as I click on the video play button.

    Someone knows how to fix this?

    Thank you

    Pako

    ---------------------------------------------

    SYM. Play ("VideoPage");

    var youtubevid = $("< iframe/>");

    SYM.$("vContainer"). Append (youtubevid);

    youtubevid.attr('type','text/html');

    youtubevid.attr('width','500');

    youtubevid.attr('height','375');

    youtubevid.Attr ('src', 'vimeo code');

    youtubevid.attr('frameborder','0');

    youtubevid.attr('allowfullscreen','0');

    -----------------------------------------------

    Adjust the line

    SYM.$("vContainer"). Append (youtubevid);

    for this

    SYM.$("vContainer"). empty(). Append (youtubevid);

    The addition of the empty() method is to make sure it clears the sandbox on successive clicks.

    HTH

    Darrell

  • PowerShot SX510 HS automatically stops video recording after 10-15 minutes in the record.

    PowerShot SX510 HS automatically stops video recording after 10-15 minutes on continuous recording. Is there a way to disable this option? I would like to record videos up until I press the button stop recording or the battery is low. I've disabled all the setting of energy saving, at least, I think I have.

    The camera has some limitations for registration, as do all models of Canon. Here's how you can extend your durations for registration to a maximum of about 1 hour, but there is a limit of 4BG regardless so once he hits 4 GB recording stops and has to be restarted.

    Also, the memory card has to be at least a class 6 rating or recording will stop as soon as possible regardless of the size of the clamp.

    It comes to page 161 of your manual

  • Windows media player 12 win7 stopped to load my music

    Hello

    Recently when I open windows media player stopped to load my music, videos and

    photos. I tried the fix as tools of Microsoft without success. Also, I ran the troubleshooting

    program and it detected that my library was corrupted, I tried to solve this problem by following the instructions of

    Microsoft help but also for nothing doesn't.

    The strange thing is that when I attach my external hard drive were to only keep a copy of my music, windows

    media player, then begins to load my music.

    Yours Sincerely,

    Kenneth Dwyer.

    Hello
    Welcome to the Microsoft community. Sorry for the delay in responding.
    Will there be any changes made before that the problem started? What are the FixIt and the steps that you have already tried to fix the problem?

    To correct the path where Windows Media Player adds the files, please follow the steps in this article.
    Add items to the Windows Media Player library

    To rebuild the library, please follow the steps in this thread:

    Hope that the information provided has been helpful and let us know if you need help. We will be happy to help you.

  • My camera iPhone 5s is accessed remotely? Whenever I use my phone torch ends up taking videos. Is it possible for a person to access my camera through the torch. We share the same Apple ID

    My camera iPhone 5s is accessed remotely? Whenever I use my phone torch ends up taking videos. Is it possible for a person to access my camera through the torch. We share the same Apple ID

    N °

    but maybe you tap the camera icon (bottom-right) when you press the icon of the torch (with the other hand maybe?)

  • How to stop to load at startup of indexing

    I use Win XP Pro, and I want to stop indexing load at startup in my system tray.  I somehow it started about 2-3 weeks ago and now I want to put an end to its use.

    Thanks for any help.

    If it's the windows index service you can turn it off via the admin tools Control Panel.
     
    If it's a third party indexing service, you may need to disable the program by clicking on the Start button > run > msconfig > Startup tab
     
     
     

    --
    db·´¯`·...¸><)))º>

    .

    "JHL1951" wrote in message news: e8e61b15-0624-44 CF-a54d-0e41cf3de646...

    I use Win XP Pro, and I want to stop indexing load at startup in my system tray.  I somehow it started about 2-3 weeks ago and now I want to put an end to its use.

    Thanks for any help.

    DB·´¯'·.. ¸ >-))) º > ·´¯'·.. ¸ >-))) º > share nirvana mann

  • iTunes stopped responding and looking for possible solutions

    Original title: ITune HELP REQUIRED

    I downloaded the latest version of ITunes for Vista (at least 3 x / 2 desktops on the same computer). Whenever I try to access get the terms, and once I did, I get a message "ITunes has stopped responding and looking for possible solutions. The solution is to download the latest version of ITunes.

    Hi Nancy Garrett.

    I suggest you to open Event Viewer and check for more details on the error code.

    Open event viewer

    http://Windows.Microsoft.com/en-us/Windows-Vista/open-Event-Viewer

     

    What are the information in event logs? (Event Viewer)

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-information-appears-in-event-logs-Event-Viewer

    In the meantime, you can also check out the link that has the similar problem of Apple's Support.

    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits unexpectedly, freezes, or launch issues

    http://support.Apple.com/kb/TS1717

    Let us know the results.

  • Phone stops random load

    Hello everyone.

    I got my Z3 2 months ago. I had no problem before recharge, it is used to load fine, but after 3 weeks, he began acting strange during the loading process. Even if the phone is connected fine, phone for a few minutes then stops to load again. The charging light turns off and when I check the phone, theres no load signal. But sometimes it charges very well without disconnecting. I thought it was the problem with my charger and I tried 2 more new Chargers and its still the same. I was running 4.4.4 when this problem occurred while I was maybe guess it is software related issue. I've updated to 5.1.1 but the problem persists. I am using the USB cable for charging. It happens with wall support and PC support, I even tried the factory reset but no luck. I do not charge wireless or a loading dock, use only the USB cable.

    Anyone has the same problem? I would be grateful if someone can help me with it. And I'm sorry if it's a bad section to ask something like that.

    Hi sjns19,

    It takes about 2,30-3 hours to fully charge a device, but it seems as if he's running much faster if the unit is say fresh 10% or less. A device getting warm during charging is normal, however you use a charger laptop Sony or third party?

  • I have Acrobat 9.5 and when I try to create &gt; pdf from a scanner, it shows an error "Adobe acrobat has stopped working". Is it possible that I can use this feature?

    I have Acrobat 9.5 and when I try to create > pdf from a scanner, it shows an error "Adobe acrobat has stopped working". Is it possible that I can use this feature?

    Providing you have Acrobat 9 installed in an operating system for which Acrobat 9 is compatible then you can use the feature.

    So, you need a scanner connected, turned on, and the software installed. Acrobat 9 "prefer" TWAIN drivers.

    Always visit the site of the provider of the Analyzer and download - install the latest version of the greatest software.

    n.b., The Acrobat 9.x product family moved in the middle of the "End of Support" year 2013.

    Thus, the family of products Acrobat 9.x is not compatible with contemporary operating systems.

    Be well...

  • XI player suddenly stopped to load all images into pdf files.  No idea why?

    XI player suddenly stopped to load all images into pdf files.  No idea why?

    Try to edit > preferences > Page display > Page content and information and remember that "Show large images" is checked.

  • I would use my own music with my videos.  Is it possible to download audio files?

    I would use my own music with my videos.  Is it possible to download audio files?

    Hank

    I also first elements 12 on 64-bit Windows 8.1, so we should be able to cross-check the issues present.

    If you have audio files saved on the hard drive of your computer (if those that came with the program or your own), then you can import them into a project of 12 items were created using the add media/files and folders/projects active where you drag the file to the workspace Expert Timeline (usually the soundtrack). (There are a quick work with film area and a bar for the soundtrack. I prefer space work Expert because I believe that it allows you to see better what is happening and therefore gives you more control over the project.)

    If you have .mp3 files, I find they work very well. If problems, then consider convert the .wav format and then import into the project. See what works for you. There are those who prefer the .wav format which they intend as superior. Go with what works for you. Perhaps compare reading the vs version .wav .mp3 and determine if you can hear a difference in reading.

    We will follow your progress.

    Thank you.

    RTA

  • How can I stop the loading of a swf file that is still ongoing.

    I have three buttons on the stage (btn1, btn2, btn3)

    When I click on the first button swf starts loading

    While the swf file loads if I press the 2nd key

    the first swf won't stop loading and the two rulers begin to play

    But if the first swf is fully charged then everything workes very well.

    so please let me how can know I stop the loading of a file that is still ongoing.

    var _contentSWF:ContentSWF

    var _content

    Btn1.addEventListener (MouseEvent.CLICK, handleClick)

    btn2.addEventListener (MouseEvent.CLICK, handleClick)

    btn3.addEventListener (MouseEvent.CLICK, handleClick)

    function handleClick() {}

    {if(_content!=undefined)}

    _contentSWF.removeContent)

    removeChild (_contentSWF);

    _contentSWF = null;

    }

    _contentSWF = new ContentSWF()

    _content = addChild (contentSWF);

    _contentSWF.init (from path.swf)

    }

    ContentSWF.as

    private var _path:String

    private var swfLoader:Loader

    private var _content

    SerializableAttribute public class ContentSWF extends Sprite {}

    public void init (path) {}

    {if(_content!=null)}

    _content. Content.RemoveEventListener (Event.COMPLETE, completeHandler)

    _content.removeChild (myMc)

    _content = null

    }

    swfLoader = new Loader();

    _path = path

    swfLoader.load (new URLRequest (path));

    swfLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, swfLoaded);

    }

    public void removeContent() {}

    swfLoader.contentLoaderInfo.removeEventListener (Event.COMPLETE, swfLoaded);

    swfLoader.unloadAndStop)

    }

    private void swfLoaded(e:Event) {}

    _content = addChild (mymc)

    }

    }

    Use your charger's close() method.  but don't try and apply only if nothing is currently responsible or, I think, you will trigger an error.

  • When I change a video loaded down in full screen, the video stops often but audio and small screen are when I again switch to full screen it works for a while and can repeat the problem.

    I don't know what I can add

    Hello Bukers,

    Thank you for your message.  Make sure that you have the latest video drivers for your system.  Go to the web site of the manufacturer of your computer and download/install the latest video driver for your device.
    Please let us know if it did or did not solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • Stop videos of auto-jouer on web sites like CNN

    While browsing CNN videos (down) load & play automatically wasting my bandwidth and especially my time.  Is there an effective way to block this type of behavior with Safari 9.1.2 on my MBP of end of 2008?  I installed AdBlock and AdBlock Ultimate with no apparent effect.

    TIA... Bill Graham

    CNN uses several different video players in their inline code, and so far I was not able to gag them. This is nonsense on the server side and the browser may have no control over what CNN grows with us. A surefire way to stop the imposed videos is to find another site with informative reports news, responsible and unbiased. I have used CNN for a very long while, and the content of the web site has finally I pushed further.

Maybe you are looking for