Playing multiple videos in single FLV instance.

Hi, I'm trying to get a video application to work. The basic
question I have is: can i get multiple videos on a flash streaming
server to play in a single FLVPlayback instance? (I want the user
to be able to choose the video based on a button, not play in
succession.) Or do I have to set up a custom player using
NetConnection and NetStream classes along with the
NetStream.play(vidname) method ?
I really need to be pointed in the right direction on this
because the project is due asap.
Thanks!!!

A single instance of FLVPlayback can handle multiple videos.
I can't remember what the upper limit is. So you can switch between
them based on user input. But I believe it can only ever play one
at any one time. I've used FLVPlayback quite a lot but not for what
you're describing, so can't answer from direct experience.
Check out this page, and the trivial example at the end
(whether its streaming or progressive is irrelevant here, streaming
should work just as well, but perhaps you need to use SMIL files
for the streaming contentPath?)
http://livedocs.adobe.com/flash/9.0/main/00002980.html#wp3780233

Similar Messages

  • Using ControlBarSample to Play Multiple Videos

    I'm trying to modify the ControlBarSample to play multiple videos and I'm running into a wall. I've made a few simple modifications to the control bar sample to try to play a second video file. The problem I'm having is the control bar doesn't have a reference to the new video I play and therefore can't update it's view. I'd like to be able to remove the video element playing in the ParallelElement and add a new child MediaElement and have the controlbar refresh it's reference to the new target. Also the controlbar shouldn't have to reload itself, but should stay right where it is in the display list and in the root parallel element. Can someone guide through this? Here is my simple modification to the ControlBarSample class as a starting point.
    package
         import flash.display.Sprite;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import org.osmf.elements.ParallelElement;
         import org.osmf.events.MediaFactoryEvent;
         import org.osmf.layout.HorizontalAlign;
         import org.osmf.layout.LayoutMetadata;
         import org.osmf.layout.VerticalAlign;
         import org.osmf.media.*;
         import org.osmf.metadata.Metadata;
         [SWF(width="640", height="360", backgroundColor="0x000000",frameRate="25")]
         public class ControlBarPluginSampleMod extends Sprite
              public function ControlBarPluginSampleMod()
                   // Construct an OSMFConfiguration helper class:     
                   osmf = new OSMFConfiguration();
                   // Construct the main element to play back. This will be a
                   // parallel element, that will hold the main content to
                   // playback, and the control bar (from a plug-in) as its
                   // children:
                   osmf.mediaElement = constructRootElement();
                   osmf.view = this;
                   // Add event listeners to the plug-in manager so we'll get
                   // a heads-up when the control bar plug-in finishes loading:
                   osmf.factory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD, onPluginLoaded);
                   osmf.factory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD_ERROR, onPluginLoadError);
                   // Ask the plug-in manager to load the control bar plug-in:
                   osmf.factory.loadPlugin(pluginResource);
                   // button to play the next item
                   var label:TextField = new TextField();
                   label.text = "PLAY NEXT";
                   label.x = 10;
                   label.y = 3;
                   label.mouseEnabled = false
                   button = new Sprite();
                   button.buttonMode = true;
                   button.addChild( label );
                   button.graphics.beginFill(0x00FFFF,1);
                   button.graphics.drawRect(0,0,90,20);
                   button.addEventListener(MouseEvent.CLICK, onButtonClick);
                   addChild(button);
              // Internals
              private var osmf:OSMFConfiguration;
              private var rootElement:ParallelElement;
              private var button:Sprite;
              private function onPluginLoaded(event:MediaFactoryEvent):void
                   // The plugin loaded successfully. We can now construct a control
                   // bar media element, and add it as a child to the root parallel
                   // element:
                   rootElement.addChild(constructControlBarElement());
              private function onPluginLoadError(event:MediaFactoryEvent):void
                   trace("ERROR: the control bar plugin failed to load.");
              private function constructRootElement():MediaElement
                   // Construct a parallel media element to hold the main content,
                   // and later on, the control bar.
                   rootElement = new ParallelElement();
                   rootElement.addChild( constructVideoElement(VIDEO_HTTP) );
                   // Use the layout api to set the parallel element's width and
                   // height. Make it as big as the stage currently is:
                   var rootElementLayout:LayoutMetadata = new LayoutMetadata();
                   rootElement.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, rootElementLayout);
                   rootElementLayout.width = stage.stageWidth;
                   rootElementLayout.height = stage.stageHeight;
                   return rootElement;
              private function constructVideoElement(url:String):MediaElement
                   // Construct a metadata object that we can append to the video's collection
                   // of metadata. The control bar plug-in will use the metadata to identify
                   // the video element as its target:
                   var controlBarTarget:Metadata = new Metadata();
                   controlBarTarget.addValue(ID, "mainContent");
                   // Construct a video element:
                   var video:MediaElement = osmf.factory.createMediaElement(new URLResource(url));
                   // Add the metadata to the video's metadata:
                   video.addMetadata(ControlBarPlugin.NS_CONTROL_BAR_TARGET, controlBarTarget);
                   return video;
              private function constructControlBarElement():MediaElement
                   // Construct a metadata object that we'll send to the media factory on
                   // requesting a control bar element to be instantiated. The factory
                   // will use it to parameterize the element. Specifically, the ID field
                   // will tell the plug-in what the ID of the content it should control
                   // is:
                   var controlBarSettings:Metadata = new Metadata();
                   controlBarSettings.addValue(ID, "mainContent");
                   // Add the metadata to an otherwise empty media resource object:
                   var resource:MediaResourceBase = new MediaResourceBase();
                   resource.addMetadataValue(ControlBarPlugin.NS_CONTROL_BAR_SETTINGS, controlBarSettings);
                   // Request the media factory to construct a control bar element. The
                   // factory will infer a control bar element is requested by inspecting
                   // the resource's metadata (and encountering a metadata object of namespace
                   // NS_CONTROL_BAR_SETTINGS there):
                   var controlBar:MediaElement = osmf.factory.createMediaElement(resource);
                   // Set some layout properties on the control bar. Specifically, have it
                   // appear at the bottom of the parallel element, horizontally centererd:
                   var layout:LayoutMetadata = controlBar.getMetadata(LayoutMetadata.LAYOUT_NAMESPACE) as LayoutMetadata;
                   if (layout == null)
                        layout = new LayoutMetadata();
                        controlBar.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layout);
                   layout.verticalAlign = VerticalAlign.BOTTOM;
                   layout.horizontalAlign = HorizontalAlign.CENTER;
                   // Make sure that the element shows over the video: element's with a
                   // higher order number set are placed higher in the display list:
                   layout.index = 1;
                   return controlBar;
              private function onButtonClick(event:MouseEvent):void
                   playNext(VIDEO_RTMP);
              private function playNext(url:String):void
                   rootElement.removeChildAt(0);
                   rootElement.addChild( constructVideoElement(url) );
              /* static */
              private static const VIDEO_HTTP:String = "http://mediapm.edgesuite.net/osmf/content/test/logo_animated.flv";
              private static const VIDEO_RTMP:String = "rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short";
              private static var ID:String = "ID";
              // Comment out to load the plug-in for a SWF (instead of using static linking, for testing):     
              //private static const pluginResource:URLResource = new URLResource("http://mediapm.edgesuite.net/osmf/swf/ControlBarPlugin.swf");
              private static const pluginResource:PluginInfoResource = new PluginInfoResource(new ControlBarPlugin().pluginInfo);

    It appears that this may be accomplished more easily if I do something similar to the StrobeMediaPlayback implementation. Looking at the StrobeMediaPlayback source code it looks like Adobe has done something a little different than their ControlBarPlugin, placing the controlbar and root media element inside separate MediaContainers and then adding those containers to the display list. Is this recommended over using the frameworks ParallelElements? If so, is communication between the control bar and root media element still a matter of just updating the target reference via metadata?

  • Snow Leopard iTunes 10.5 will not play multiple video tracks in QuickTime .MOV files

    I recently discovered that Snow Leopard iTunes version 10.5 won't play multiple video tracks in a QuickTime .MOV file.
    Both video tracks appear and play correctly when playing the file in:
    - QuickTime Player 10 or QuickTime Player 7.7 on the same Snow Leopard machine
    - iTunes 10.3.1 on another Snow Leopard machine
    - iTunes 10.5 on Leopard or Windows 7
    So I think the problem is iTunes 10.5 on Snow Leopard (although I haven't been able to test iTunes 10.4).
    First test file is two 640x480 video tracks side-by-side (total dimensions 1280x480):
    http://160.94.17.23/demo/two-video-tracks-1280x480.mov
    All I see is the first (left) video track, and not the right one.  iTunes "Get Info" command incorrectly reports the video dimensions of the file as 640x480.
    Second test file is two 640x480 video tracks played one after another (duration of 10 seconds each):
    http://160.94.17.23/demo/two-video-tracks-640x480.mov
    All I see is the first video track, and although it reports the correct file duration (20 seconds), the second video track never appears -- it simply freezes on the final frame of the first video track for the last 10 seconds.
    Anyone else see similar behavior?  Unless I'm missing something, I suppose I should submit this as a bug to Apple.

    I have the same problem, i tried re-installing, converting it to AVC H264 but none seems to work so far

  • HT3775 i cant play some videos that has flv please any solution to it? thanks

    i cant play some videos that has flv please any solution to it? thanks

    agodey4,
    Some reading here, mant players for download, do w= a web search.
    http://www.ifunia.com/mac-os/howto-play-flv-videos-on-mac-os-x-lion.html

  • What is good practice for playing multiple video's in a single swf?

    Hello,
    I have build in the past a video wall with video's inside. After building this i came across some problems.
    If you have too many video players loading at once it takes a lot of processing and the tweens in the
    page while loading the video's where not moving fluidly, but more in a stuttering way.
    After lot's of test i found a good working solution.  I imported the flv video's into flash en exported them on the timeline
    as a embedded swf.  Then i externally loaded these swf files and that performed much better.
    Is it even good practice to load multiple video instances at once? I used this time the LoaderMax of greensock but the video's
    only play after it's completely loaded. I would like to find a way to progressive play all video's at.
    Does someone has experience with this?
    Regards,
    Chris.

    How about an XML file which supplies the title for each movie and the location or source of the video to be played?  Simple version below.
    <?xml version="1.0" ?>
    - <playlist>
    <video src="Gfx/video/Alex1.f4v" title="John Deere 330" />
    <video src="Gfx/video/Benni1.f4v" title="Hitachi Z240F" />
    <video src="Gfx/video/Scotti1.f4v" title="Hitachi Z350F" />
    <video src="Gfx/video/Scotti2.f4v" title="Hitachi Z350F" />
    </playlist>
    JR

  • Playing multiple videos in sequence

    Hello all. I'm a complete newbie to Flash development, but
    have been thrown into it with not just a deadline, but a (to me)
    "complex" project. I have a Flash project which currently opens and
    plays a video as part of whats on "the stage". I now need to add 2
    more videos which will play, in sequence, after the first one
    finishes. I've gone through the tutorials, read the help files, and
    now I'm just feeling a bit "DUH" because I still can't figure out
    how to do this. Anybody out there care to help a poor ol' graphics
    guy avoid the bitter wrath of his boss?

    A single instance of FLVPlayback can handle multiple videos.
    I can't remember what the upper limit is. So you can switch between
    them based on user input. But I believe it can only ever play one
    at any one time. I've used FLVPlayback quite a lot but not for what
    you're describing, so can't answer from direct experience.
    Check out this page, and the trivial example at the end
    (whether its streaming or progressive is irrelevant here, streaming
    should work just as well, but perhaps you need to use SMIL files
    for the streaming contentPath?)
    http://livedocs.adobe.com/flash/9.0/main/00002980.html#wp3780233

  • Play multiple videos in sequence

    Hi,
    I've multiple videos stored in FMS and would like to merge them into a single video object in order to play all of them in sequence (so that a user thinks it's a single longer video). Is it possible?

    This is a link from 3.5 but have you tried this:
    http://www.overdigital.com/2009/08/02/flash-media-server-as-video-editingstitching-tool/

  • Playing Multiple Video Clips on the Same page

    Hi Folks,
    Let's try this again. If I set up a page with a single flv
    playing off our Flash Media Server 2, everything works just fine.
    If I create a page with several flv files on it, some of them load
    and then I get nailed with Certificate Alerts. All of the videos
    are coming from the same server, same designation and work fine -
    just not when there are several of them on the same page.
    Thoughts and comments are most welcomed
    Thanks - Greg

    Certificate alerts, as in SSL certs? I'm wondering if you
    have some sort of connection shotgun that's causing some of the
    connections to try an rtmps or rtmpts connection. If you have a lot
    of connections trying at once and something botttlenecks, that
    might be the result.
    It would be helpful if you provide some more details,
    including the text of the alret and the code you're using to
    connect to FMS.
    Incidentally, does your application absolutely require that
    you have separate swf's making connections to FMS? It would be a
    shame to waste all of those connections if there is any practical
    way around it.

  • Best Option For Playing Multiple Videos

    (CS3 AS2.0)
    Hi,
    I'm tweaking a flash website for a freind and he wants to have some videos play from a page. There are 25 files and ideally I want to achieve the 'Lightbox' look so that the browser window dims and the video plays over the top. After looking around I haven't found any easy solutions.
    What is the best way to achieve this, bearing in mind I shall have all these buttons on a page and want to have the video 'float' on top of the actual site?
    I'm relatively new to this although a long standing flash user when it comes to animation etc - not great on scripting.
    If you could point me to a link or help with the terminology I need that would be great. All my video files are FLV and ready to go. Need to know how to link in with the buttons I already have in place.
    Help greatly appreciated!
    K.

    Here's a link to what I'm after but the solution is in CS4 with AS 3.o and I'm using the previous versions
    http://www.gotoandlearnforum.com/viewtopic.php?t=25095

  • Multiple SDM for single WAS instance

    Can I have 2 SDM for a single WAS instance ?

    Are you talking about SDM servers or SDM clients? There's no need to have multiple SDM servers for one WebAS server.

  • StageVideo play multiple videos in sequence (playlist) on iOS

    Hi everyone!
    I have to play severals locals videos in sequence with stageVideo (imagine an dynamic background wich runs an playlist).
    Its runs very well (the MP4 videos play smoothly) but when the videos are switching appear an full sreen white frame for 3 seconds and later the second video start to play (on my iPhone4). 
    private function netStreamStatus(event:NetStatusEvent):void{
             if (event.info.code == "NetStream.Play.Stop"){
                     netStream.play(VIDEO2)
    If i rewind the first video (loop) the white frame never appear:
    private function netStreamStatus(event:NetStatusEvent):void{
               if (event.info.code == "NetStream.Play.Stop"){
                     netStream.seek(0)
    ¿How can i do an smooth video change with an stageVideo and ios devices?
    Thanks a lot!

    Here i attach an FXP project (Flex 4.6 Mobile APP) wich play some videos with stageVideo.
    You can see in a real device like iPhone 4 (not desktop) an BLACK screen when swtiching videos (about 3 seconds).
    Can anyone helpme please?
    Thanks a lot!
    http://goo.gl/75tBz

  • Quicktime playing multiple videos question

    Hello Everyone.
    This is probably more of a html/java/flash based question but I thought I would start here as it revolves around the QT Player.
    I have a webpage
    http://www.drewwfilms.com/Temp/Ket/KetWedding.html
    On this page is the QT Player.
    Beneath the player are 3 buttons. When a viewer clicks one of those buttons I want it to load the respective video related to that button into the player without the browser loading a new page. Is this possible?
    Can someone steer me the right direction? Or help me out? I'm not even sure how to google search this. I tried Multiple Videos, 1 QT player Web - and I didn't get anything that helped.
    Thanks!

    I've been having this truly obnoxious problem ever since I installed Lion. Whenever I open a Quicktime video or a preview jpeg (and sometimes a Word document) - the last two or three documents I've viewed in these programs also open.
    This is the normal default mode for Lion which now "remembers" what documents (files, movies, images, etc) were opn when you last "Quit" each application. Either learn to close the documents before "quitting" the app or turn this feature off. (I.e., deselect the "System Preferences > Personal > General > Restore windows when quitting and re-opening apps" option.)

  • ? play multiple videos simultanously with a single control bar ?

    I have 4 live f4vs that I'm using with interactive server 3.5.  Thus they are running in dvr.  I'm trying to find a way to control all 4 videos so that when you go back on one video all 4 videos go back to the same time.  This is very important with camera 4 as it is the only one with sound.
    I have tried putting all 4 videos in one swf file and I have tried putting each video as its own swf.  So far I can't figure out how to do it, any help would be greatly appreciated.
    Thanks
    stjc3
    I know something similar was listed previously at
    http://forums.adobe.com/message/64579
    But the link to the solution is bad
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1292827&enterthread=y

    Thanks for the quick responce.
    The streams are very close to being in sync but they tend to be about half a second to a couple of seconds out of sync.  I tried using the timecode in fmle but when I do that it seems to mess up the dvr feature and kill 2 or more streams so that you can only watch old data and not new.
    So... Will it still work if they are mostly insync?  If so how do I customize the seekbar?
    Also are there any extra steps I need to take since The size of the file will continue to increase while the player is in use?
    Thanks again
    stjc3

  • Is it possible to play multiple videos in sync?

    I need to build a website which shows multiple instruments in a band, being played in sync.  Each camera/video block is a different instrument, and played together, they constitute an entire band.  I have been searching high and low for ways to do this, and it definitely appears that HTML5 is out.  It looks like standard FLV progressive download is out, too, because it's impossible to get 4-8 videos to sync perfectly.
    I see on the FMS page that it has some abilities in synching.  How would one (conceptually) go about making a webpage where say 4-8 videos begin to buffer, then when ready, play in sync?  And they would also need to, when the location is changed, all sync to that location and rebuffer. 
    The objective is so that the user can mute/solo each video's audio, to remove an instrument(s) from the "mix" at any time.
    An alternative way of doing this, I think, would be to just put the 4-8 videos together in video editing, and encode this into one video, but have each video's audio track be a separate audio channel.  If FMS can do multichannel audio on one video, this might work, if it could mix them in/out individually, as the user requires.
    Any insights on this problem would be greatly, greatly appreciated. 
    Thanks!

    sandyaudiovisual,
    Very good point.  I was, in a way, asking both.
    Yes, it appears that actually streaming multiple streams of video while visibly playing in synchronization simultaneously will be very difficult.
    So, I was thinking that as an alternative, I could pre-mix the multiple "streams" of video into just one video.  E.g., a single video file, with for example five squares each with a different video inside of it.  So to the view, in a sense, it looks like five streaming videos in sync.
    What I would then want to do, in that situation, is be able to mute/solo an audio track associated with each "video".  In reality, it would be a single video channel, with five audio channels, switchable while maintaining synchronicity.  Though the extra wiggle is that rather than simply switching between 1 and 5, it would be preferable to actually mix in/out channels 1-5, so that at any time, 1, 2, 3, 4, or 5 audio channels would be playing, in synchronicity, and could be muted/soloed.
    To give a visual idea, there would likely be a mute and solo button composited on top of each "video" box inside the main video.
    It would be easier if we could actually stream five separate video files and have them be in sync, with all stopping to wait should one need to rebuffer, and all sharing the same transport controls, because then if we want to swap out one video, we just swap that file, rather than remake the entire file in Final Cut or whatever.  But this is sounding less and less possible.

  • Play multiple videos (all on xml file) to play on button action

    I am trying to make a swf with one FLV playback player and 6 buttons.
    I've got 6 different videofiles that I want to have linked to this swf. Some of the videos are quit large.
    When starting the Swf, the first video has to start, after playing it, it has to stop. Then you must be able to choose which video to play by clicking one of the buttons. I don't want to have small thumbnails of the video, just plain and simple buttons.
    I have to have all my files, both fla, swf and xml files in the same directory (I cannot have them stored in different folders, since I have to upload this to a cms system which has limited upload properties).
    I've tried to find the right script on the internet, I'm not very good at scripting myselve, actually rather poor educated there...
    It seems to me that I have to make an xml file with a list of all my videos, I have my default swf ready, with a FLVplayback and buttons.
    Now there's just the coding part....
    Please can someone help me out here?

    assign your flvplayback component an instance name (eg, flv).  you can then assign its source property to play your flv files.
    for example:
    btn1.addEventListener(MouseEvent.CLICK,f1);
    function f1(e:Event0:void{
    flv.source="yourflvcorrespondingtobtn1.flv";

Maybe you are looking for

  • Problems with Flash thumbnail gallery

    Hi there, I am an artist trying to remake my website...I have a picture of a window on my homepage. The window is a movie. When clicked on, the window lights turn on and a grid of thumbnail pics appear. Each thumbnail is a movie clip. When a thumbnai

  • I work nights. Can I switch Travel Time in iCal from work to home?

    I work nights. Can I switch Travel Time in iCal from work to home? I really don't have any appointments from 11 pm to 7 am when I work, but I don't want to switch when my day starts in preferences as no one else in my family works nights. Any suggest

  • [Solved] KDE power managment fails

    Just did a fresh arch install on my laptop and put KDE on it but power-devil won't work like it should. It doesn't see the laptop battery and doesn't detect the cpu frequency scaling ability. I'm kind off clueless about this one since power managment

  • SAP Latest Software Version for ERP

    Guys, I am out of touch with SAP terminologies from long and getting confused when searching forums. Can someone help me here? I remember SAP ERP use to be, SAP 4.6c->SAP 4.7->SAP ECC5.0->SAP ECC6.0....which one is the latest? ECC6.0 or it is again c

  • GS60 Ghost Pro 3k - Joining Windows DOMAIN

    Just got my new GS60-2PE laptop, reformatted and reinstalled Windows 8.1, and joined to the domain.  Things are working great, except every time I am outside the office it completely craps out -  nothing works, windows system32 services are not start