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

chore: sync videojs-contrib-hls updates #75

Merged
merged 24 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5b21e02
Add nvmrc and update travis' chrome reference (#1322)
gesinger Jan 25, 2018
255f729
Update karma reconnect configuration to match video.js' (#1323)
gesinger Jan 25, 2018
dbfc035
Remove IE11 section from README (#1325)
gesinger Jan 25, 2018
4624a05
Throttler: Minor changes to make throttler work with native safari (#…
mrocajr Jan 25, 2018
fdec3dd
Add jsDelivr link (#1274)
LukasDrgon Jan 25, 2018
11987cc
update url-toolkit to ^2.1.3 (#1327)
tjenkinson Jan 26, 2018
d263eea
Update dependencies to enable Greenkeeper 🌴 (#1347)
greenkeeper[bot] Feb 20, 2018
80e9b0b
Fix tech.play() throwing unresolved promise errors on Chrome (#1338)
grobolom Feb 27, 2018
7a632c2
Update README.md (#1358)
ahmet2106 Mar 5, 2018
e2f40f2
use webwackify for webworkers to support webpack bundle (#1363)
mjneil Mar 7, 2018
907de56
update CHANGELOG
mjneil Mar 7, 2018
216f32b
5.13.0
mjneil Mar 7, 2018
03a268b
Add greenkeeper ignore section to package.lock (#1364)
gesinger Mar 7, 2018
1eaea13
More useful info in segment-metadata cue (bandwidth/resolution/codecs…
tchakabam Mar 15, 2018
2d7fe12
fix: Fix env for travis so greenkeeper can properly update lock file …
mjneil Mar 15, 2018
66f0997
update videojs-contrib-media-sources to 4.7.1 and webwackify to 0.1.5…
mjneil Mar 15, 2018
970ea92
update CHANGELOG
mjneil Mar 15, 2018
38051cc
5.14.0
mjneil Mar 15, 2018
ca8d9e4
Update webwackify to the latest version 🚀 (#1380)
greenkeeper[bot] Mar 20, 2018
ef9cc35
Update videojs-contrib-media-sources to the latest version 🚀 (#1382)
greenkeeper[bot] Mar 21, 2018
337a501
update CHANGELOG
mjneil Mar 21, 2018
a3ecfd0
5.14.1
mjneil Mar 21, 2018
2e6fa25
Merge remote-tracking branch 'hls/master' into sync-contrib-hls
Apr 2, 2018
16bd606
update changes
Apr 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ videojs(video, {html5: {
// or

var options = {hls: {
withCredentials: true;
withCredentials: true
}};

videojs(video, {html5: options});
Expand Down Expand Up @@ -581,6 +581,10 @@ will have this structure

```javascript
cue.value = {
byteLength, // The size of the segment in bytes
bandwidth, // The peak bitrate reported by the segment's playlist
resolution, // The resolution reported by the segment's playlist
codecs, // The codecs reported by the segment's playlist
uri, // The Segment uri
timeline, // Timeline of the segment for detecting discontinuities
playlist, // The Playlist uri
Expand Down
8 changes: 7 additions & 1 deletion src/master-playlist-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,13 @@ export class MasterPlaylistController extends videojs.EventTarget {
// code in video.js but is required because play() must be invoked
// *after* the media source has opened.
if (this.tech_.autoplay()) {
this.tech_.play();
const playPromise = this.tech_.play();

// Catch/silence error when a pause interrupts a play request
// on browsers which return a promise
if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {
playPromise.then(null, (e) => {});
}
}

this.trigger('sourceopen');
Expand Down
4 changes: 4 additions & 0 deletions src/segment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,10 @@ export default class SegmentLoader extends videojs.EventTarget {

const Cue = window.WebKitDataCue || window.VTTCue;
const value = {
bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
resolution: segmentInfo.playlist.attributes.RESOLUTION,
codecs: segmentInfo.playlist.attributes.CODECS,
byteLength: segmentInfo.byteLength,
uri: segmentInfo.uri,
timeline: segmentInfo.timeline,
playlist: segmentInfo.playlist.uri,
Expand Down
15 changes: 15 additions & 0 deletions test/master-playlist-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2501,3 +2501,18 @@ QUnit.test('properly configures loader mime types', function(assert) {
'correct mime type for audio segment loader');
assert.notOk(audioMimeTypeCalls[0][1], 'no source buffer emitter');
});

QUnit.test('Exception in play promise should be caught', function(assert) {
const mpc = this.masterPlaylistController;

mpc.setupSourceBuffers = () => true;
mpc.tech_ = {
autoplay: () => true,
play: () => new Promise(function(resolve, reject) {
reject(new DOMException());
})
};
mpc.handleSourceOpen_();

assert.ok(true, 'rejects dom exception');
});
31 changes: 26 additions & 5 deletions test/segment-loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,12 @@ QUnit.module('SegmentLoader', function(hooks) {
'as they are buffered',
function(assert) {
const track = loader.segmentMetadataTrack_;
let playlist = playlistWithDuration(50);
const attributes = {
BANDWIDTH: 3500000,
RESOLUTION: '1920x1080',
CODECS: 'mp4a.40.5,avc1.42001e'
};
let playlist = playlistWithDuration(50, {attributes});
let probeResponse;
let expectedCue;

Expand Down Expand Up @@ -441,7 +446,11 @@ QUnit.module('SegmentLoader', function(hooks) {
timeline: 0,
playlist: 'playlist.m3u8',
start: 0,
end: 9.5
end: 9.5,
bandwidth: 3500000,
resolution: '1920x1080',
codecs: 'mp4a.40.5,avc1.42001e',
byteLength: 10
};

assert.equal(track.cues.length, 1, 'one cue added for segment');
Expand All @@ -458,7 +467,11 @@ QUnit.module('SegmentLoader', function(hooks) {
timeline: 0,
playlist: 'playlist.m3u8',
start: 9.56,
end: 19.2
end: 19.2,
bandwidth: 3500000,
resolution: '1920x1080',
codecs: 'mp4a.40.5,avc1.42001e',
byteLength: 10
};

assert.equal(track.cues.length, 2, 'one cue added for segment');
Expand All @@ -475,7 +488,11 @@ QUnit.module('SegmentLoader', function(hooks) {
timeline: 0,
playlist: 'playlist.m3u8',
start: 19.24,
end: 28.99
end: 28.99,
bandwidth: 3500000,
resolution: '1920x1080',
codecs: 'mp4a.40.5,avc1.42001e',
byteLength: 10
};

assert.equal(track.cues.length, 3, 'one cue added for segment');
Expand All @@ -494,7 +511,11 @@ QUnit.module('SegmentLoader', function(hooks) {
timeline: 0,
playlist: 'playlist.m3u8',
start: 19.21,
end: 28.98
end: 28.98,
bandwidth: 3500000,
resolution: '1920x1080',
codecs: 'mp4a.40.5,avc1.42001e',
byteLength: 10
};

assert.equal(track.cues.length, 3, 'overlapped cue removed, new one added');
Expand Down
2 changes: 1 addition & 1 deletion test/test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export const playlistWithDuration = function(time, conf) {
uri: conf && typeof conf.uri !== 'undefined' ? conf.uri : 'playlist.m3u8',
discontinuitySequence:
conf && conf.discontinuitySequence ? conf.discontinuitySequence : 0,
attributes: {}
attributes: conf && typeof conf.attributes !== 'undefined' ? conf.attributes : {}
};
let count = Math.floor(time / 10);
let remainder = time % 10;
Expand Down