You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Do live RTMP playlists work? Created Feb 24, 2010

This thread is solved

Views: 1957     Replies: 5     Last reply Oct 29, 2011  
You must login first before you can use this feature

therickster

Posts: 3

Registered:
Feb 24, 2010

Do live RTMP playlists work?

Posted: Feb 24, 2010

I had included this in a previous post about not getting onStart events, but this one is the killer and I thought I'd put it in a separate thread.

I have a number of live RTMP threads I'd like to monitor. If I put them in a playlist as shown below, the first one starts up, hits the 20 second duration and just keeps on going. The second and subsequent ones never play.

What have I got wrong, or does duration even work with live RTMP?


clip: { 
    netConnectionUrl: 'rtmp://aspecialserver.tld/live', 
    live: true, 
    duration: 20, 
    autoplay: true, 
    provider: 'rtmp', 
 
}, 
 
playlist: [ 
    { url: 'stream17@17776' }, 
    { url: 'stream18@17777' }, 
    { url: 'stream19@17778' }, 
    { url: 'stream20@17779' }, 
    { url: 'stream21@17780' } 
], 
 
plugins: { 
    rtmp: { 
        url: 'flowplayer.rtmp-3.1.3.swf', 
        subscribe: true 
    }    
}

truegodtv
Franklin Mayfield Director, trueGOD.tv http://www.trueGOD.tv

Posts: 6

Registered:
Jan 20, 2010

» Do live RTMP playlists work?

Posted: Oct 28, 2011

Reply to: Do live RTMP playlists work?, from therickster
If you make live: false, the duration will work, but then the pause, play does not work. Is there a work around for this. I have searched and cannot find an answer for this. I have a playlist that requires specific times from multiple netconnections (switching between streams). And with llive: false I am good, but the pause/play issue then is broken. Clicking pause on a live stream does not restart it live: false is set.

Any way to get both working?

Thank you.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » Do live RTMP playlists work?

Posted: Oct 28, 2011

Reply to: » Do live RTMP playlists work?, from truegodtv
It's probably not implemented because it's sorta video on demand in a live setup.

Try to work around the problem like this:


clip: {
  live: true,
  provider: "rtmp"
},
playlist: [{
  url: "stream1",
  onStart: function () { // onBegin ??
    var player = this;
    setTimeout(function () {
      player.play(1); // play next in list
    }, 20000); // 20 secs
  }
}, {
  url: "stream2",
  onStart: function () {
    var player = this;
    setTimeout(function () {
      player.play(2);
    }, 40000); // 40 secs
  }
} // etc. ]

In case the duration does not vary you could do a loop in the common clip's onStart event.

Disclaimer: untested because I have no live streams available. But you get the general idea.

truegodtv
Franklin Mayfield Director, trueGOD.tv http://www.trueGOD.tv

Posts: 6

Registered:
Jan 20, 2010

» » » Do live RTMP playlists work?

Posted: Oct 29, 2011

Reply to: » » Do live RTMP playlists work?, from blacktrash
The only problem that I have with your solution, is I have a RRS playlist that is generated. How would I do something similar to your solution with that?

Another approach I tried, (but it did not work) is to change the state of the live: false (which allows duration to work from playlist), to live: true onPause, then back to false onResume. But doing it with variable changes, or functions, did not work either. Does the player recognize changes to the live: on the fly on only on load?

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » Do live RTMP playlists work?

Posted: Oct 29, 2011

Reply to: » » » Do live RTMP playlists work?, from truegodtv
You could add a custom property to the clips in question in the rss file, like:


<item>
  <!-- yadda yadda -->
  <liveduration>20000</liveduration>
</item>

And then in the common clip configuration:


clip: {
  onBegin: function (clip) {
    if (clip.liveduration) {
      var player = this;
      setTimeout(function () {
        if (clip.index < player.getPlaylist().length) {
          // play next in playlist
          player.play(clip.index + 1);
        } else {
          // last clip: stop after clip.liveduration
          player.stop();
        }
      }, clip.liveduration);
    }
  }
}

If all your clips have the liveduration property you obviously can remove one if-clause.

In case onBegin does not work, try onStart.

truegodtv
Franklin Mayfield Director, trueGOD.tv http://www.trueGOD.tv

Posts: 6

Registered:
Jan 20, 2010

» » » » » Do live RTMP playlists work?

Posted: Oct 29, 2011

Reply to: » » » » Do live RTMP playlists work?, from blacktrash
Great Job, this one is solved! Thank you.