0 Replies Latest reply on Dec 30, 2010 6:24 PM by Tony404

    POST ROLL VIDEO ADS AND LIVE STREAM

    Tony404 Level 1

      Hello guys

       

      Much resently video and audio streaming has become very popular. Most clients want pre-roll and post-roll functions.  pre-roll is when video or audio ads play before the main video or audio plays. post-roll is when a video pauses in the middle playing an ad roll before continuing to the end.

       

       

      I have a live stream application thats a combination of the Php, xml, flash live encoder, flash media server and flash 8 application with some actionscript 2.0.

       

      The actionscript code plays the live video from the flash live encoder fine. Now I am trying to load post-roll video ads using  Php, xml so that the videos are played in 15 minute intervals.To get the the 15 minute interval I use action-scipt setInterval function.

       

      The problem I am having is how to mute and load the advert video clips over the live stream when its muted.The plan is play the imported video ads one after the other. After the last video plays I would like to un-mute the livestream to continue untill the next interval.

       

       

      //This is some prototype code. I have been trying to read the xml videos but not sure how to get them to play one after the other before unmuting the live stream and waiting for the next interval to load other video ad breaks.

       

       

      myVideo.isLive = true;

       

      //interval untill mute and video ads then loaded.

       

      setInterval( 100000, toExecute);  

       

      function toExecute()
      {

       

      var urls:Array = [];

       

      var index:Number;
      var indexa:Number;
      var index2:Number;

       


      var xml:XML = new XML();
      xml.ignoreWhite = true;
      xml.onLoad = parseXML;
      xml.load("match.php");

       

      function parseXML(){
          for(var i:Number=0;i<this.firstChild.childNodes.length;i++){
              urls.push(this.firstChild.childNodes[i].firstChild.nodeValue);
          }

       

      index=0;
      indexa=1;
      index2=2;

       

          startyourappF();

       

      }

       

      //Trying to play one after the other video ads on the holder movie object. And how to un mute the live stream so the live stream plays on.

       

      function startyourappF(){

       

      //Holder is the mask canvas that hovers over the live stream after the interval has reach

       

      holder.loadMovie(urls[index]);

       

      holder.loadMovie(urls[indexa]);

       

      holder.loadMovie(urls[index2]);




      }

       

      }

       

      Thanks.

       

      Hope you can help.