I use VideoJS to stream live from the Wowza server, but when I pause the player and they play again, the player does not restore the stream. I need to reload a webpage in order to start the stream again.
<video id="videoID" class="video-js vjs-default-skin vjs-big-play-centered" poster="/images/image.png" controls="controls" width="320" height="240" data-setup='{"techOrder": ["flash"]}'> <source src="rtmp://www.myhost.com:1935/live/live.stream" type="rtmp/mp4" /> </video>
Is there a way to stop or restart VideoJS when a paused event occurs?
EDIT: I came across a solution using this script:
<script type="text/javascript"> var myPlayer = videojs('videoID'); videojs("videoID").ready(function(){ var myPlayer = this; myPlayer.on("pause", function () { myPlayer.on("play", function () { myPlayer.load (); myPlayer.off("play"); }); }); }); </script>
source share