f2204738 by David LaPalomento

Merge pull request #136 from videojs/feature/vjs-4.7.2

Update video.js to fix seeking and autoplay
2 parents 55e7dd78 543cb87a
......@@ -34,7 +34,7 @@
"karma-safari-launcher": "~0.1.1",
"karma-sauce-launcher": "~0.1.8",
"sinon": "1.10.2",
"video.js": "git+https://github.com/dmlap/video-js.git#0.6.1-alpha"
"video.js": "^4.7.2"
},
"dependencies": {
"videojs-contrib-media-sources": "^0.3.0"
......
......@@ -121,6 +121,13 @@ videojs.Hls.prototype.handleSourceOpen = function() {
this.playlists.on('mediachange', function() {
player.trigger('mediachange');
});
// if autoplay is enabled, begin playback. This is duplicative of
// code in video.js but is required because play() must be invoked
// *after* the media source has opened.
if (player.options().autoplay) {
player.play();
}
};
/**
......
......@@ -160,14 +160,15 @@ module('HLS', {
test('starts playing if autoplay is specified', function() {
var plays = 0;
player.play = function() {
plays++;
};
player.options().autoplay = true;
player.src({
src: 'manifest/playlist.m3u8',
type: 'application/vnd.apple.mpegurl'
});
// make sure play() is called *after* the media source opens
player.play = function() {
plays++;
};
openMediaSource(player);
standardXHRResponse(requests[0]);
......