Skip to content

Play button/function does not work after pause/stopping live video (vod is fine). #86

@RidleyLycan

Description

@RidleyLycan

This issue is only for live version, the vod works fine.
If video is stopped (pause/stop/video disconnects) the play button and function does not work.
However using .load() (reloading the source) then using play works.

I found a live rtmp source and vod rtmp source that seems to be rather stable, and used them in the sample code to test for yourself. Try stop the live video, then press either play buttons, they won't work, but hit 'load liveSource' and then it works.
Example here: https://gist.github.com/RidleyLycan/0fffcc9d3cf0159f90fa06ea47ace92a

Or this:
`

<script src="https://cdn.jsdelivr.net/gh/clappr/clappr@latest/dist/clappr.min.js"></script>
<script src="http://cdn.jsdelivr.net/clappr.rtmp/latest/rtmp.min.js"></script>
<div id="live-wrapper" ></div>
<script>
  var liveSource = 'rtmp://146.185.61.140:1935/live/myStream';  // source found on http://www.vlc.eu.pn
  var livePlayer = new Clappr.Player({
    source: liveSource, parentId: "#live-wrapper", 
      plugins: {'playback': [RTMP]},
      rtmpConfig: {
        //swfPath: 'dist/assets/RTMP.swf',
        playbackType: 'live' 
      },    
  });
</script>
<button type="button" onClick="livePlayer.play()">livePlayer.play</button> <!-- .play() does not work if video is paused/stopped/disconnected unless one use .load() the source again -->
<button type="button" onClick="livePlayer.pause()">livePlayer.pause</button>
<button type="button" onClick="livePlayer.stop()">livePlayer.stop</button>
<button type="button" onClick="livePlayer.load(liveSource)">load liveSource</button>

<br/><br/><br/>

<div id="vod-wrapper" ></div>
<script>
  var vodSource = 'rtmp://184.72.239.149/vod/mp4:bigbuckbunny_1500.mp4';  // found on wowza forums:
  var vodPlayer = new Clappr.Player({
    source: vodSource, parentId: "#vod-wrapper", 
      plugins: {'playback': [RTMP]},
      rtmpConfig: {
        //swfPath: 'dist/assets/RTMP.swf',
        playbackType: 'vod' 
      },  
  });
</script>
<button type="button" onClick="vodPlayer.play()">vodPlayer.play</button> 
<button type="button" onClick="vodPlayer.pause()">vodPlayer.pause</button>
<button type="button" onClick="vodPlayer.stop()">vodPlayer.stop</button>
<button type="button" onClick="vodPlayer.load(vodSource)">load vodSource</button>
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions