Live Streaming H.264 Video on iOS using AIR

We would like to build an AIR app that plays Streaming H.264 Live/VOD videos that would work through AIR on the iOS platform.
I've seem some traffic on the forums that RTMP will work to iOS - but additionally heard that video applications that use RTMP streams will be rejected by the Apple App store.
I have seen that progressive H.264 will work - but that's not streaming or live.
HLS would work if we use the StageWebView object; however, that provides us little control/monitoring over the video inside of it; and it's not "really" integrated as a video player.
For OSMF there seems to be a 3rd-Party plugin which will allow OSMF to read HLS streams - but (from what I've heard) is incomplete because it doesn't play adaptive nor is it completely updated for OSMF 1.6.1.
I would love to be wrong here - but is there currently a way to play a Streamed H.264 Video to iOS that is non-RTMP?
I've seem little information as to if F4M streamed files played via OSMF will work on iOS.
Thanks for the info in advance.
-Will

I pasted a stripped down version of my test app below, that attempts to playback an m3u8 file. This works for me on an IPad2.
Remember to test on the device itself otherwise wont work.
Dependencies:
1. Air 3.1
2. OSMF 1.6.1
3. Flex SDK 4.6.0
renderMode="direct"
HTH
- Abey
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               xmlns:s="library://ns.adobe.com/flex/spark"
               backgroundAlpha="0"
               backgroundColor="#000000"
               addedToStage="onViewActivate(event)"
               applicationDPI="160">
    <fx:Script>
        <![CDATA[
            private var nc:NetConnection;
            private var ns:NetStream;
            private var video:Video;
            private var currentVidUrl:String;
            protected function onViewActivate(event:Event):void
                nc = new NetConnection();
                nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
                nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityErrorHandler, false, 0, true);
                currentVidUrl = "http://fmsserver/hls-vod/sample.mp4.m3u8";
                nc.connect(null);
            private function onNetStatus(evt:NetStatusEvent):void
                switch (evt.info.code) {
                    case "NetConnection.Connect.Success":
                        ns = new NetStream(nc);
                        var client:Object = {};
                        client.onMetaData = onMetaData;
                        client.onCuePoint = onCuePoint;
                        client.onBWDone = onBWDone();
                        ns.client = client;
                        nc.client = client;
                        var v:Vector.<StageVideo> = stage.stageVideos;
                        if (v.length >= 1) {
                            var stageVideo:StageVideo = v[0];
                            stageVideo.viewPort = new Rectangle(0, 0, mediaContainer.width, mediaContainer.height);
                            stageVideo.attachNetStream(ns);
                        else {
                            video = new Video();
                            video.width = mediaContainer.width;
                            video.height = mediaContainer.height;
                            mediaContainer.addChildAt(video,0);
                            video.attachNetStream(ns);
                        if (currentVidUrl) {
                            ns.play(currentVidUrl);
                        break;
                    case "NetStream.Publish.BadName":
                        break;
                    default:
                        break;
            private function onSecurityErrorHandler(event:SecurityErrorEvent):void
            protected function onMetaData(item:Object):void
            protected function onCuePoint(item:Object):void
            protected function onBWDone():void
        ]]>
    </fx:Script>
    <mx:UIComponent id="mediaContainer"
                    height="100%"
                    width="100%"/>
</s:Application>

Similar Messages

  • Live streaming h.264 not showing video

    I'm using FMLE 3.1 to stream live video encoded with H.264 format with  FMS 3 and Flash player 10 + AS 3 to connect to the stream.
    When I connect to the stream, just the audio is played. I'm able  even to get the metadata information about the video, but I just receive  the audio.
    I already tried some stuff like
    1. "Flash 10 won't play live stream H.264 after iTunes install"  http://forums.adobe.com/thread/505620. I tested it in a complete  different environment than mine, but the same result.
    2. I've tried some format to play method, but this is just to play  files
    ns.play("mp4:saple.f4v");
    ns.play("mp4:sample");
    3. Also read "How do you watch and record a live h.264" http://www.flashcomguru.co.uk/forum/forum_posts.asp?TID=4649 , but I  don't get even to play the stream at first place.
    This is the code I'm using 
    import flash.media.Video;
    var video:Video = new Video(720, 480);
    var ncVideo = new NetConnection();
    this.ncVideo.addEventListener(NetStatusEvent.NET_STATUS,  onNetStatus);
    this.ncVideo.connect("rtmp://localhost/livecast", "user");
    var customClient:Object = new Object();
    customClient.onMetaData = metaDataHandler;
    function onNetStatus(e:NetStatusEvent) {
         if (e.info.code == "NetConnection.Connect.Success")
                createNetStream();
    function createNetStream(){
         var ns = new NetStream(this.ncVideo);
         ns.client = customClient;
          ns.addEventListener(NetStatusE vent.NET_STATUS, onNsStatus);
         ns.play("livestream", -1);
          this.video.attachNetStream(ns) ;
         this.addChild(video);
    function onNsStatus(e) {
         trace("onNsStatus " + e.info.code);
    function metaDataHandler(infoObject:Object):void {
         trace(infoObject.width + " - " + infoObject.height);
    Another detail is that when I record the video to a file for  instance "sample.f4v", I put this video in the FMS but when I connect to  this stream I receive the "FileStructureInvalid" error message.
    I went from changing the extension to .flv http://www.adobe.com/devnet/flashplayer/articles/hd_video_f  lash_player_04.html to the solution to flatten the files http://www.flashcomguru.com/forum/forum_posts.asp?TID=4006 but this is  not the case because I'm using FMS to stream the recorded video.

    Please note that this  forum category is for help with the Flash Player and  NOT for users seeking assistance with  programming Flash and/or Flex. If you are seeking assistance with programming,   click here and choose the  proper category to post in.

  • Live Streaming from static video file

    Hi everybody,
    I'm using Amazon Cloud & Flash MMedia Server 4.5.
    I would like to take one of my exits videos (a static file), and turn it into a live stream. People can view this video (synchronous). I'm using Flash Media Live Encoder 3.2, but it only capture video from devices as camera...
    How I can do it?
    Cheers.

    Hi Huy,
    Please find the zip attached where I have written the scripts for you to deploy on your local FMS server, in context of option 2:
    You may like to follow these steps:
    1. unzip the folder.
    2. deploy FLVpublishonLoad (in case your recorded file is a FLV use case) on your lcoal server
    3. deploy toPublish on your remote aws server
    4. make sure to correct the path for aws in FLVPublishonLoad application @ line#19:
    // Please mention your aws instance hostname instead of localhost , and application name ....
    nc.connect("rtmp://localhost/toPublish");
    5. go to admin console of your local development server and load the instance of FLVPublishonLoad as shown in the howtoLoadfromAdminConsole.png image attached for refrence purpose.
    6. it will automatically connect to the "toPublish" app on your remote server and start publishing your local vod file as a live stream to your aws instance
    7. start your subscriber app and subscribe to the stream you have used in FLVPublishonLoad app for Stream.get() method, see line#29 and the subscriberScreenExample.png file attached for the illustration purpose.
    few points to note here:
    1. I have removed the sample.flv and "sample1_1500kbps.f4v" for keeping the zip size lower.
    2. You need to put your stream name at line#55 where you call mystream.play()
    3. The stream name that you specify in Stream.get() will be used by subscribers.
    4. if your use case is mp4, then please use "MP4PublishonLoad" instead of "FLVPublishonLoad" application.
    =============
    As I am unable to attach the files here therefore copy-pasting the code for you and others to be re-used:
    =======
    main.asc code for FLVPublishonLoad:
    var nc;
    var ns;
    application.onAppStart = function()
        trace("hello client: ");
        publishIt();
    function publishIt()
        trace("publishing");
        nc = new NetConnection();
        // Please mention your aws instance hostname instead of localhost , and application name ....
        nc.connect("rtmp://localhost/toPublish");
        nc.onStatus = function(info)
            trace(info.code);
        ns = new NetStream(nc);
        // Exact stream name available for subscribers .....
        mystream = Stream.get("myvodfile");
        mystream.onStatus = function(sinfo)
            trace("mystream.onStatus: "+sinfo.code);
            if(sinfo.code == "NetStream.Publish.Start")
                attach_retVal = ns.attach(mystream);
                if(attach_retVal==true)
                        trace("stream attach was successful ...");
                        startPublish();
                else
                    trace("The attempt to attach stream source to NetStream failed");
        // Please put the stream name here inside double-quotes that you want to publish and is available there in streams/_definst_ folder ......
        mystream.play("sample",0,-1,true);
    function startPublish()
        ns.publish(mystream.name,"live");
    main.asc code for MP4PublishonLoad:
    var nc;
    var ns;
    application.onAppStart = function()
        trace("hello client ");
        publishIt();
    function publishIt()
        trace("publishing");
        nc = new NetConnection();
        // Please mention your aws instance hostname instead of localhost , and application name ....
        nc.connect("rtmp://localhost/toPublish");
        nc.onStatus = function(info)
            trace(info.code);
        ns = new NetStream(nc);
        // Exact stream name available for subscribers .....
        mystream = Stream.get("mp4:myvodfile.f4v");
        mystream.onStatus = function(sinfo)
            trace("mystream.onStatus: "+sinfo.code);
            if(sinfo.code == "NetStream.Publish.Start")
                attach_retVal = ns.attach(mystream);
                if(attach_retVal==true)
                        trace("stream attach was successful ...");
                        startPublish();
                else
                    trace("The attempt to attach stream source to NetStream failed");
        // Please put the stream name that you want to publish and is available there in streams/_definst_ folder ......
        mystream.play("mp4:sample1_1500kbps.f4v",0,-1,true);
    function startPublish()
        trace("#### " + mystream.name);
        ns.publish("mp4:" + mystream.name,"live");
    main.asc code for "toPublish" app
    =====================
    application.onPublish = function(clientObj, streamObj)
        trace("published: " + streamObj.name);
    =====================
    Please revert back to me in case of further query.
    Regards,
    Shiraz Anwar

  • How to Live Stream h.264 via FME?

    I would like to take advantage of benefits of H.264 for our
    live event streaming. Can this be done with FME?
    Is there another option to encode and stream to our CDN
    server in H.264?
    thanks for your help.

    There is currently no way to live encode H.264 using a CDN..
    since no-one has yet updated to FMS3. Then there is the issue with
    the live encoder.. I'm pretty sure that Adobe is going to release a
    new FME soon to support the h.264 codec

  • Encoding h.264 video for iPad using Adobe Media Encoder CS5

    Hi guys!
    I'm upgrading a clients website to HTML5 video and I'm having a VERY hard time using Adobe Media Encoder CS5 for  encoding movies that are going to be embedded and played on iPad.
    I've tried different resolutions, different profiles (Baseline Profile, Level 3.0, Baseline Profile, Level 3.1, Main Profile, Level 3.0 and so on).
    Here's more info from one of my test clips:
    * * * MediaInfo Mac 0.7.36.0 file analysis report.
    * * * MediaInfo Mac is ©2010 by Diego Massanti - http://mediainfo.massanti.com
    * * * MediaInfoLib by Jerome Martinez - http://mediainfo.sourceforge.net
    Created on: 8 jan 2011 17:50:03 CET
    Report for file: test_b3_0.mp4
    General / Container Stream #1
        Total Video Streams for this File.................1
        Total Audio Streams for this File.................1
        Video Codecs Used.................................AVC
        Audio Codecs Used.................................AAC LC
        File Format.......................................MPEG-4
        Play Time.........................................55s 808ms
        Total File Size...................................14.1 MiB
        Total Stream BitRate..............................2 122 Kbps
    Video Stream #1
        Codec (Human Name)................................AVC
        Codec (FourCC)....................................avc1
        Codec [email protected]
        Frame Width.......................................854 pixels
        Frame Height......................................480 pixels
        Frame Rate........................................25.000 fps
        Total Frames......................................1394
        Display Aspect Ratio..............................16:9
        Video Standard....................................PAL
        Scan Type.........................................Progressive
        Color Space.......................................YUV
        Codec Settings (Summary)..........................2 Ref Frames
        QF (like Gordian Knot)............................0.195
        Codec Settings (CABAC)............................No
        Codec Settings (Reference Frames).................2
        Video Stream Length...............................55s 760ms
        Video Stream BitRate..............................1 995 Kbps
        Video Stream BitRate Mode.........................VBR
        Bit Depth.........................................8 bits
        Video Stream Size.................................13.3 MiB (94%)
        Video Stream Language.............................English
        Date of Original Encoding.........................UTC 2011-01-07 13:20:32
    Audio Stream #1
        Codec.............................................AAC
        Codec (FourCC)....................................40
        Audio Stream Length...............................55s 808ms
        Audio Stream BitRate..............................125 Kbps
        Audio Stream BitRate Mode.........................VBR
        Number of Audio Channels..........................2
        Audio Channel's Positions.........................Front: L R
        Sampling Rate.....................................48.0 KHz
        Audio Stream Size.................................854 KiB (6%)
        Audio Stream Language.............................English
        Date of Original Encoding.........................UTC 2011-01-07 13:20:32
    All kind of help is appreciated since I already spent more than a day trying to get this to work.

    Even Main Profile, Level 3.1 (compressed with AME CS5) works in the real thing when embedding according to my "reports".
    Gaaaah, what a waste of time relying on a not-so-reliable simulator!

  • Recommended setup for live streaming of HD video and HE-AAC audio (5.1 channels)

    Hi,
    Could anybody please post a working hardware configuration for streaming HD video (720p) and 5.1 channel audio using HE-AAC via FMLE3?
    What is your experience and what kind of professional equipment would you recommend (camera, capture card, type of cables used, PC specs incl. CPU and memory, etc.)?
    I'm looking for a portable solution that ideally supports two concurrent streams (at different bit-rates) and multi-pass encoding (yes, I know that professional hardware supports that even for a live setting with a little delay).
    FMLE (or is it Windows?) seems to be very picky as far as the recognition of HD data from specific input sources is concerned. Hence my question before investing into new hardware.
    Thanks you.

    Flash Player does not support 5.1 audio at this time, only 2 channel audio.
    For what you describe, you may want to consider one of the streaming appliances or solutions from companies like ViewCast, Digital Rapids, or Inlet.  ViewCast and Digital Rapids both offer portable appliances.
    Flash Media Live Encoder does not support two-pass encoding, the only solution that I'm aware of that does this for Flash is Kulabyte that offers a 2-pass software solution as well as a complete solution with hardware.
    If you use a capture card with FMLE you'll be fine with HD inputs, the problem seems to be with cameras that only offer HD source as MPEG-2 and FMLE only supports RAW input at this time.
    Laurel Reitman
    Sr. Product Manager

  • Streamed H.264 videos not playing correctly thru IE

    I'm new at web stuff so this is probably the dopiest question yet, but here goes.
    I'm setting up a web page where my clients can stream a "quick-start" QT movie. My tests have worked perfectly on my own computer (Mac Quicksilver) using Safari and QT7 Pro. It even works when I force them to play using the latest RealPlayer. My partner can't seem to view them on her PC using Explorer. So I did a test where I tried to view them through Explorer too, and I got the same problems.
    From reading other threads, it seems this may have something to do with "tags." Can someone explain what tags do and what I might need to do to my videos to play more universally?

    Streaming media needs special "properties" called hint tracks inside the media and is also only served from special software.
    99% + of the files you view are "downloaded". They use "fast start" to begin playback as soon as enough data has downloaded so that they can play without having to re-buffer (reload) data.
    QuickTime plug-in "guesses" the download progress and begins playback (if the file properties or the page code is set to "autoplay") when enough data has been downloaded.
    Streaming media can't include some other neat QuickTime "tricks" (like Flash media or text tracks).
    We really need some rain down our way. I just answered a knock at my door. It was three Redfish and a really skinny flounder (maybe he was standing sideways) and they asked for a drink of water.
    My PDF will teach you some "tricks" and help you get the most from QuickTime Pro. Plus, it will put something other than roadkill wild hog or deer into my diet.

  • First live stream help! What equipment to use?

    My company will be streaming a local event soon and I was
    wondering what equipment is needed/recommended to use. All I can
    come up with is a Camera, Laptop and Internet access? I'm sure
    theres something else. How do I get the stream to my server from a
    Downtown area? Will bandwidth be out of this world if it is High
    Def and lots of viewers? Looking for some some help in the right
    direction. Also, is it possible to have 2 cameras streaming?

    I replied to the dupe of this post in the FMS forum. In short
    it comes down to video production equipment. You need to approach
    it like it you would any video production. Yes you could get the
    show off with those 3 pieces of equip (plus capture card) but it
    may wind up looking like ***.

  • How to open a pdf in its native reader in iOS using AIR?

    Hi there,
    I am wondering if there is any feasability of opening a pdf directly in its native reader in iOS environment. I needed this to happen from an AIR application.
    I have found that AIR can be extended using a java program to do the above task for Android.
    here is the link: http://www.jamesward.com/2011/05/11/extending-air-for-android/
    Thanks in advance,
    Sris

    Thanks everyone for the solutions.
    After working all the possibilities to open locally saved file on iPad
    1. StageWebView 
    2. navigateToUrl
    3. file.openWithDefaultApplication();
    4. Java socket extension for AIR,
    I finally found a solution.
    StageWebView works on ipad.
    the code that works is as suggested by xperiments.es.fr
    But the problem I faced was saving the pdf and opening the locally saved file.
    Since iOS does not support desktopDirectory & documentDirectory, I tried to save the pdf in applicationDirectory/applicationStorageDirectory, that didnt work when I tried to open the pdf from those locations.
    So the only way was to store the generated PDF in a temporary directory and StageWebView could locate and load that
    It works!!!
    Now the next challenge is, while the desktop (Windows) compilation of the app shows PDF reader with menu options, which does not show on iPad app. IPad app shows just a page index on left-top corner. It would be good if the options are shown as well.
    Lets see!!!
    Cheers,
    Sris

  • H.264 vid in iOS app -AIR 2.6 only-

    A little workaround to video performance issues on iOS...
    http://forums.adobe.com/thread/827505?tstart=0

    A little workaround to video performance issues on iOS...
    http://forums.adobe.com/thread/827505?tstart=0

  • How do I create a variable video delay of a live stream...

    I have a live video feed from my webcam in my Flash Application. I have a second video window next to it that I want to place a variable delayed video of the live stream. Therefore, I need to save the video stream in memory/disk and create this variable delay, say 5-60 seconds. As well as, continue to capture the live stream. The camera I am using suppots H.264 encoding.
    How do I create a variable length queue or buffer to hold the video stream coming into the flash application. Do I create a memory variable or write this to disk ? I have been looking over the ActionScript 3.0 documentation and I can not figure out how to code this either way ( as a memory variable or write to disk queue ).
    I want to be able to change the delay, view the delay stream in slow motion and scrub through the delayed stream.
    I would like to do this with out having to use Flash Media Server.
    Thanks,
    Bob

    I am sure it is practically impossible to accomplish that on the client side. Although theoretically it is conceivable to use NetStream.appendBytes() but it requires an extremely complex implementation.
    I suggest you look into FMS DVR capacities:
    http://help.adobe.com/en_US/flashmediaserver/devguide/WS236AE81A-5319-4327-9E44-310A93CA09 C6Dev.html

  • How to use Phone camera for live streaming rather than using WireCast camera in Live streaming using Azure Media Services

    Hi,
    am planning to develop a live streaming app using C# and xaml.
    I have gone through the below sample and am able to stream the live content using wireacst camera.
    Azure Media Services Live Streaming Sample
    But i want to use Phone camera to stream the live video rather using wirecast camera.
    How can i use that? How to get the published URL from the C# code, is there any API to get that?
    Anybody please help me
    Regards,
    Santhosh

    Hello,
    There are no in box components that will allow you to transmit captured video from a Windows Phone device to Azure Media Services. You will need to create you own implementation. You can do this by creating a custom Media Foundation sync that can plug into
    the MediaCapture element's pipeline. You will then need to modify the captured and compressed video to align to one of the two protocols that Azure Media services can use. At this time Azure Media services can use either Smooth Streaming or RTMP for ingestion.
    You will need to create your own packager (or find compatible packager code from a 3rd party) to package the MP4 encoded data into the necessary format.
    Here is an example of how to create a custom Media Foundation sync (please note you must write your Media Foundation components using C++ MoCOM. We do not support Media Foundation components written in managed languages):
    Real-time communication sample
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

  • Use HTTP Dynamic Streaming (HDS) and HTTP Live Streaming (HLS) to serve live streams to clients over HTTP

    I have created a live stream of a video and it gets stored in live folder.
    Now i need to use HTTP Dynamic Streaming (HDS) and HTTP Live Streaming (HLS) to serve live streams to clients over HTTP, publish the streams to the HTTP Live Packager service on Flash Media Server.
    So what necessary steps do I  need to follow to do that ??

    You need to generate a manifest file using Configurator tool and placed it under the webroot directory.
    C:\Program Files\Adobe\Flash Media Server 4.5\tools\f4mconfig\configurator

  • Doubt regarding HTTP Live Streaming for windows phone 8.1 silverlight app?

    Hi,
    I am developing a Windows phone 8.1 silverlight app.
    I want to add live streaming youtube channel , thats why I used  https://phonesm.codeplex.com/ this link as a reference , and I am able to play the links given in the samples, but I am unable to play my link https://www.youtube.com/watch?v=p2GF-QQS6n0
    I am getting 3108 unable to play media error with my link,
    My question Is there any need of streaming server ?
    If yes can anyone help how to  create the streaming server.
    Thanks....
    Suresh.M

    Hi Suresh.M
    As I can see a similar question on the Windows Phone Streaming Media discussion:
    https://phonesm.codeplex.com/discussions/545737
    You may need check into the call stack and find out what is the root cause, for instance if there any chance that your phone cannot reach to the video address, and did you enable some network capabilities, etc.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Running a live stream from an XML playlist

    I have just successfully installed Adobe FMS on my server.
    I would now like to know how to program a script to run a continuous live stream, of MP4 videos, from an XML playlist.
    Can anyone tell me how to do this? ...or provide me a good tutorial? (I am a complete newbie to ActionScript.)
    Thanks in advance...

    application.allowDebug = true;
    application.onAppStart = function(){
    this.userID =0;
    this.playObj = new Object();
    this.timObj = new Object();
    this.passCli = new Object();
    this.couObj = new Object();
    this.couObj.count = 1;
    application.so0 = SharedObject.get("so",false);
    this.dates = new Object;
    this.dates.dat0 = new Date().valueOf()+"a";
    this.dates.dat1 = new Date().valueOf()+"b";
    this.dates.dat2 = new Date().valueOf()+"c";
    this.dates.dat3 = new Date().valueOf()+"d";
    this.myStream = new Object;
    this.myStream.st = Stream.get (this.dates.dat0.toString());
    this.myStream.st1 = Stream.get (this.dates.dat1.toString());
    this.myStream.st2 = Stream.get (this.dates.dat2.toString());
    this.myStream.st3 = Stream.get (this.dates.dat3.toString());
    this.int0
    this.int1
    this.int2
    this.int3
    this.int4
    this.lock0=0;
    this.lock1=0;
    this.lock2=0;
    this.lock3=0;
    this.lock4=0;
    listen();
    function listen(){
    clearInterval(application.int3);
    application.int0 = setInterval(time,1000,application.myStream.st);
    application.myStream.st.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock0==0){
      trace("code0"+info.code);
      clearInterval(application.int0);
      application.timObj.tim = 0;
      application.int1 = setInterval(time,1000,application.myStream.st1);
      application.couObj.count = 2;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen1(application.myStream.st1);
      application.lock0=1;
      function listen1(mystreamst1){
      mystreamst1.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock1==0){
      trace("code1"+info.code);
      mystreamst1 = null;
      clearInterval(application.int1);
      application.timObj.tim = 0;
      application.int2 = setInterval(time,1000,application.myStream.st2);
      application.couObj.count = 3;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen2(application.myStream.st2);
      application.lock1=1
      function listen2 (mystream2){
    mystream2.onStatus = function(info){
    trace("code2"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock2==0){
      clearInterval(application.int2);
      application.mystream2 = null;
      application.timObj.tim = 0;
      //application.int3 = setInterval(time,1000,application.myStream.st3);
      application.couObj.count = 4;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
         application.lock2=1;
      listen3(application.myStream.st3);
      function listen3(mystream3){
    mystream3.onStatus = function(info){
    trace("code3"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock3==0){
      trace("yes yes yes yes yes yes");
      clearInterval(application.int3);
      application.couObj.count = 1;
      mystream3 = null;
      application.timObj.tim = 0;
      //application.int4 = setInterval(time,1000,application.myStream.st);
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      application.lock0=0;
      application.lock1=0;
      application.lock2=0;
      application.lock3=0;
    application.dates.dat0 = new Date().valueOf()+"e";
    application.dates.dat1 = new Date().valueOf()+"f";
    application.dates.dat2 = new Date().valueOf()+"g";
    application.dates.dat3 = new Date().valueOf()+"h";
    application.myStream.st = Stream.get (application.dates.dat0.toString());
    application.myStream.st1 = Stream.get (application.dates.dat1.toString());
    application.myStream.st2 = Stream.get (application.dates.dat2.toString());
    application.myStream.st3 = Stream.get (application.dates.dat3.toString());
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    listen();
    ///here next
    application.onConnect = function(client){
    application.acceptConnection(client);
    application.passCli.cli = client;
    client.call("setUserID",null,this.userID);
    this.userID++;
    if(application.clients.length == 1 ){
    videoArray = new Array();
    var playlist = new XML();
    playlist.ignoreWhite = true;
    //parse xml play list for individual elements
    playlist.onLoad = function( success ) {
    if(playlist.loaded == true) {
    if (playlist.firstChild.hasChildNodes()) {
    for (var aNode = playlist.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
    if (aNode.nodeType == 1) {
    //create array from parsed xml elements.
    videoArray[aNode.attributes.id] = aNode.attributes.name ;
    //pass array out of onload function
    application.playObj.vid = videoArray;
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    pass0(videoArray);
    //play first video on playlist
    playlist.load("http://www.privatechatnow.com/fmsuser/playlist.xml");
    }//end onetime if statement
    function pass0(videoArray){
      //receive array
      //play intial video
      if(application.clients.length == 1){
    // application.playObj.vid=videoArray;
    playcurr(application.passCli.cli);
    for (var key in application.playObj){
    trace(key + ": " + application.playObj[key]);
       //put currently playing videio into object
      //isolate playlist switching loop for each connected client
      //listen to currently playing stream with onStatus
      //change to next video in playlist
      //use onStatus and current duration and seek to scrub to cuurently playin video each time a user connects.
      //continue untill playlist is played then loop back to first video in playlist.
        //onConnect play currently playing video
    if (application.clients.length >1){
    playcurr(application.passCli.cli);
    //message client with currently play flv
    //message client when flv changes
    //message client with metadata
    application.onPublish = function(clientObject, streamObject){
    trace("Stream name :: "+streamObject.name);
    function switchStream(so0){
    if(application.couObj.count == 1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
        nextlen = application.playObj.vid[1].length;
    so0.send("playSecond",application.playObj.vid[0],clength,currlen,nextlen);
    if(application.couObj.count == 2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
    nextlen = application.playObj.vid[2].length;
        so0.send("playSecond",application.playObj.vid[1],clength,currlen,nextlen);
    if(application.couObj.count == 3){
    clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        so0.send("playSecond",application.playObj.vid[2],clength,currlen,nextlen);
    if(application.couObj.count == 4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        so0.send("playSecond",application.playObj.vid[3],clength,currlen,nextlen);
    function playcurr(client){
    trace("count = "+application.couObj.count.toString());
    if(application.couObj.count ==1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
      nextlen = application.playObj.vid[1].length;
        client.call("playZero",null,application.playObj.vid[0],clength,currlen,nextlen); 
    if(application.couObj.count ==2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
      nextlen = application.playObj.vid[2].length;
        client.call("playZero",null,application.playObj.vid[1],clength,currlen,nextlen); 
    if(application.couObj.count ==3){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        client.call("playZero",null,application.playObj.vid[2],clength,currlen,nextlen); 
    if(application.couObj.count ==4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        client.call("playZero",null,application.playObj.vid[3],clength,currlen,nextlen); 
    application.onDisconnect = function(oldclient){
    if(application.clients.length ==0){
    this.userID--;
    function time(myStream){
    application.timObj.tim = myStream.time;

Maybe you are looking for

  • Display resolution conflict

    I tried to increase the resolution of my display beyond the limits of the monitor. How do I change back to a compatible resolution when the monitor won't show an image. Is there some key I can press during bootup to force some sort of safe mode?

  • Itunes 10.5 has stopped working message on windows vista

    Hey Guys. I've just updated to iTunes 10.5, currently running vista 32bit. I get an error message when i try and start up itunes saying itunes has stopped working, then this... Problem Event Name:          APPCRASH   Application Name:          iTunes

  • CS4 InDesign Slow with files opened from shared drive

    We have an issue that I can't seem to figure out... I have six different people using Word files and InDesign files that are being opened from a server. When going from Word into InDesign (or vise verse) it takes a few seconds for the cursor to becom

  • 2G shuffle autofill with convert not working

    Since updating to iTunes 7.5 I've been unable to sync (autofill with convert to 128 kbps). It begins syncing but repeatedly goes back to the beginning and resyncs. It's been going three days straight without making it through. I'm running Vista and t

  • How to resize the video (locked ratio)

    Ok guys, it sounds pretty noobish, but how do I resize this to a custom size? The ratio is locked, so I can't stretch it.