Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RidleyLycan opened this issue Sep 12, 2017 · 0 comments

Comments

@RidleyLycan
Copy link

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>
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant