I´m using VideoJS for a live stream from Wowza server but when I pause the player and them I play again the player does not recover the stream. I need to reload the webpage 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>
There are any method to do stop or VideoJS reload when the paused event appear?
EDIT: I've encountered the 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>
Ok so i found a solution. Instead of stripping all of the play events form the player you actually just need to edit the flash play event inside of video.dev.js on line 7337 (in version 4.11.4 i think). this is the line that says:
vjs.Flash.prototype.play = function(){
this.el_.vjs_play();
};
it should be changed to say:
vjs.Flash.prototype.play = function(){
this.el_.vjs_load();
this.el_.vjs_play();
};
so that the load event is called before the play event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With