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 @@ ...@@ -34,7 +34,7 @@
34 "karma-safari-launcher": "~0.1.1", 34 "karma-safari-launcher": "~0.1.1",
35 "karma-sauce-launcher": "~0.1.8", 35 "karma-sauce-launcher": "~0.1.8",
36 "sinon": "1.10.2", 36 "sinon": "1.10.2",
37 "video.js": "git+https://github.com/dmlap/video-js.git#0.6.1-alpha" 37 "video.js": "^4.7.2"
38 }, 38 },
39 "dependencies": { 39 "dependencies": {
40 "videojs-contrib-media-sources": "^0.3.0" 40 "videojs-contrib-media-sources": "^0.3.0"
......
...@@ -121,6 +121,13 @@ videojs.Hls.prototype.handleSourceOpen = function() { ...@@ -121,6 +121,13 @@ videojs.Hls.prototype.handleSourceOpen = function() {
121 this.playlists.on('mediachange', function() { 121 this.playlists.on('mediachange', function() {
122 player.trigger('mediachange'); 122 player.trigger('mediachange');
123 }); 123 });
124
125 // if autoplay is enabled, begin playback. This is duplicative of
126 // code in video.js but is required because play() must be invoked
127 // *after* the media source has opened.
128 if (player.options().autoplay) {
129 player.play();
130 }
124 }; 131 };
125 132
126 /** 133 /**
......
...@@ -160,14 +160,15 @@ module('HLS', { ...@@ -160,14 +160,15 @@ module('HLS', {
160 160
161 test('starts playing if autoplay is specified', function() { 161 test('starts playing if autoplay is specified', function() {
162 var plays = 0; 162 var plays = 0;
163 player.play = function() {
164 plays++;
165 };
166 player.options().autoplay = true; 163 player.options().autoplay = true;
167 player.src({ 164 player.src({
168 src: 'manifest/playlist.m3u8', 165 src: 'manifest/playlist.m3u8',
169 type: 'application/vnd.apple.mpegurl' 166 type: 'application/vnd.apple.mpegurl'
170 }); 167 });
168 // make sure play() is called *after* the media source opens
169 player.play = function() {
170 plays++;
171 };
171 openMediaSource(player); 172 openMediaSource(player);
172 173
173 standardXHRResponse(requests[0]); 174 standardXHRResponse(requests[0]);
......