Gary Katsevman
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
36 additions and
0 deletions
-
src/videojs-http-streaming.js
-
test/videojs-http-streaming.test.js
|
|
@ -511,6 +511,12 @@ class VhsHandler extends Component { |
|
|
|
videojs.log.warn('Using hls options is deprecated. Use vhs instead.'); |
|
|
|
} |
|
|
|
|
|
|
|
// if a tech level `initialBandwidth` option was passed
|
|
|
|
// use that over the VHS level `bandwidth` option
|
|
|
|
if (typeof options.initialBandwidth === 'number') { |
|
|
|
this.options_.bandwidth = options.initialBandwidth; |
|
|
|
} |
|
|
|
|
|
|
|
this.logger_ = logger('VhsHandler'); |
|
|
|
|
|
|
|
// tech.player() is deprecated but setup a reference to HLS for
|
|
|
|
|
|
@ -2913,6 +2913,36 @@ QUnit.test( |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
QUnit.test('respects initialBandwidth option on the tech', function(assert) { |
|
|
|
this.player.dispose(); |
|
|
|
this.player = createPlayer({ html5: { initialBandwidth: 0 } }); |
|
|
|
|
|
|
|
this.player.src({ |
|
|
|
src: 'http://example.com/media.m3u8', |
|
|
|
type: 'application/vnd.apple.mpegurl' |
|
|
|
}); |
|
|
|
|
|
|
|
this.clock.tick(1); |
|
|
|
|
|
|
|
openMediaSource(this.player, this.clock); |
|
|
|
assert.equal(this.player.tech_.vhs.bandwidth, 0, 'set bandwidth to 0'); |
|
|
|
}); |
|
|
|
|
|
|
|
QUnit.test('initialBandwidth option on the tech take precedence on over vhs bandwidth option', function(assert) { |
|
|
|
this.player.dispose(); |
|
|
|
this.player = createPlayer({ html5: { initialBandwidth: 0, vhs: { bandwidth: 100 } } }); |
|
|
|
|
|
|
|
this.player.src({ |
|
|
|
src: 'http://example.com/media.m3u8', |
|
|
|
type: 'application/vnd.apple.mpegurl' |
|
|
|
}); |
|
|
|
|
|
|
|
this.clock.tick(1); |
|
|
|
|
|
|
|
openMediaSource(this.player, this.clock); |
|
|
|
assert.equal(this.player.tech_.vhs.bandwidth, 0, 'set bandwidth to 0'); |
|
|
|
}); |
|
|
|
|
|
|
|
QUnit.test('uses default bandwidth if browser is Android', function(assert) { |
|
|
|
this.player.dispose(); |
|
|
|
|
|
|
|