Skip to content

Commit aaeafa4

Browse files
authored
feat(HLS): Deprecate useSafariBehaviorForLive config (#6978)
1 parent a35028c commit aaeafa4

File tree

8 files changed

+12
-22
lines changed

8 files changed

+12
-22
lines changed

demo/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ shakaDemo.Config = class {
257257
'manifest.hls.mediaPlaylistFullMimeType')
258258
.addBoolInput_('Ignore Program Date Time from manifest',
259259
'manifest.hls.ignoreManifestProgramDateTime')
260-
.addBoolInput_('Use Safari behavior for live',
261-
'manifest.hls.useSafariBehaviorForLive')
262260
.addNumberInput_('Live segments delay',
263261
'manifest.hls.liveSegmentsDelay')
264262
.addBoolInput_('Enable HLS sequence mode', 'manifest.hls.sequenceMode')

docs/tutorials/upgrade.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ application:
114114
with the relevant options: `enabled`, `targetLatency`,
115115
`targetLatencyTolerance`, `maxPlaybackRate`, `minPlaybackRate`, `panicMode`
116116
`panicThreshold`. (deprecated in v4.10.0)
117+
- `useSafariBehaviorForLive` has been removed.
117118

118119
- Plugin changes:
119120
- `TextDisplayer` plugins must implement the `configure()` method.

externs/shaka/player.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,6 @@ shaka.extern.DashManifestConfiguration;
10921092
* ignoreManifestProgramDateTime: boolean,
10931093
* ignoreManifestProgramDateTimeForTypes: !Array<string>,
10941094
* mediaPlaylistFullMimeType: string,
1095-
* useSafariBehaviorForLive: boolean,
10961095
* liveSegmentsDelay: number,
10971096
* sequenceMode: boolean,
10981097
* ignoreManifestTimestampsInSegmentsMode: boolean,
@@ -1137,12 +1136,6 @@ shaka.extern.DashManifestConfiguration;
11371136
* format this value.
11381137
* <i>Defaults to
11391138
* <code>'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'</code>.</i>
1140-
* @property {boolean} useSafariBehaviorForLive
1141-
* If this is true, playback will set the availability window to the
1142-
* presentation delay. The player will be able to buffer ahead three
1143-
* segments, but the seek window will be zero-sized, to be consistent with
1144-
* Safari. If this is false, the seek window will be the entire duration.
1145-
* <i>Defaults to <code>true</code>.</i>
11461139
* @property {number} liveSegmentsDelay
11471140
* The default presentation delay will be calculated as a number of segments.
11481141
* This is the number of segments for this calculation..

lib/hls/hls_parser.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,7 @@ shaka.hls.HlsParser = class {
11311131
const PresentationType = shaka.hls.HlsParser.PresentationType_;
11321132

11331133
if (this.presentationType_ == PresentationType.LIVE) {
1134-
let segmentAvailabilityDuration = this.getLiveDuration_();
1135-
1136-
// This defaults to the presentation delay, which has the effect of
1137-
// making the live stream unseekable. This is consistent with Apple's
1138-
// HLS implementation.
1139-
if (this.config_.hls.useSafariBehaviorForLive) {
1140-
segmentAvailabilityDuration = this.presentationTimeline_.getDelay();
1141-
}
1134+
let segmentAvailabilityDuration = this.getLiveDuration_() || 0;
11421135

11431136
// The app can override that with a longer duration, to allow seeking.
11441137
if (!isNaN(this.config_.availabilityWindowOverride)) {

lib/player.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,6 +3837,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
38373837
delete config['mediaSource']['sourceBufferExtraFeatures'];
38383838
}
38393839

3840+
// Deprecate 'manifest.hls.useSafariBehaviorForLive' configuration.
3841+
if (config['manifest'] && config['manifest']['hls'] &&
3842+
'useSafariBehaviorForLive' in config['manifest']['hls']) {
3843+
shaka.Deprecate.deprecateFeature(5,
3844+
'manifest.hls.useSafariBehaviorForLive configuration',
3845+
'Please Use liveSync config to keep on live Edge instead.');
3846+
delete config['manifest']['hls']['useSafariBehaviorForLive'];
3847+
}
3848+
38403849
// If lowLatencyMode is enabled, and inaccurateManifestTolerance and
38413850
// rebufferingGoal and segmentPrefetchLimit and baseDelay and
38423851
// autoCorrectDrift and maxDisabledTime are not specified, set

lib/util/player_configuration.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ shaka.util.PlayerConfiguration = class {
162162
ignoreManifestProgramDateTimeForTypes: [],
163163
mediaPlaylistFullMimeType:
164164
'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',
165-
useSafariBehaviorForLive: true,
166165
liveSegmentsDelay: 3,
167166
sequenceMode: shaka.util.Platform.supportsSequenceMode(),
168167
ignoreManifestTimestampsInSegmentsMode: false,

test/ads_integration.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ describe('Ads', () => {
4848
adManager = player.getAdManager();
4949
await player.attach(video);
5050

51-
player.configure('manifest.hls.useSafariBehaviorForLive', false);
52-
5351
// Disable stall detection, which can interfere with playback tests.
5452
player.configure('streaming.stallEnabled', false);
5553

test/hls/hls_live_unit.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,7 @@ describe('HlsParser live', () => {
663663
}
664664

665665
it('does not affect seek range if unset', async () => {
666-
// 15 seconds is three segment durations.
667-
await testWindowOverride(15);
666+
await testWindowOverride(2000);
668667
});
669668

670669
it('overrides default seek range if set', async () => {

0 commit comments

Comments
 (0)