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

Bandwidth limitation not working for HLS/Safari #3486

Closed
saringer opened this issue Jun 24, 2021 · 6 comments
Closed

Bandwidth limitation not working for HLS/Safari #3486

saringer opened this issue Jun 24, 2021 · 6 comments
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated status: working as intended The behavior is intended; this is not a bug

Comments

@saringer
Copy link

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
3.1.1

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from master?
Yes

Are you using the demo app or your own custom app?
Custom App

If custom app, can you reproduce the issue using our demo app?

What browser and OS are you using?
macOS Big Sur, Safari 14.1.1

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

Provided via Email

What configuration are you using? What is the output of player.getConfiguration()?

"{
"drm": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"servers": {
"com.widevine.alpha": "...",
"com.microsoft.playready": "...",
"com.apple.fps.1_0": "..."
},
"clearKeys": {},
"advanced": {
"com.apple.fps.1_0": {
"distinctiveIdentifierRequired": false,
"persistentStateRequired": false,
"videoRobustness": "",
"audioRobustness": "",
"sessionType": "",
"serverCertificate": {
...
},
"individualizationServer": ""
}
},
"delayLicenseRequestUntilPlayed": false,
"logLicenseExchange": false,
"updateExpirationTime": 1
},
"manifest": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"availabilityWindowOverride": null,
"disableAudio": false,
"disableVideo": false,
"disableText": false,
"disableThumbnails": false,
"defaultPresentationDelay": 0,
"dash": {
"clockSyncUri": "",
"ignoreDrmInfo": false,
"disableXlinkProcessing": false,
"xlinkFailGracefully": false,
"ignoreMinBufferTime": false,
"autoCorrectDrift": true,
"initialSegmentLimit": 1000,
"ignoreSuggestedPresentationDelay": false,
"ignoreEmptyAdaptationSet": false,
"ignoreMaxSegmentDuration": false,
"keySystemsByURI": {
...
}
},
"hls": {
"ignoreTextStreamFailures": false,
"useFullSegmentsForStartTime": false
}
},
"streaming": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"rebufferingGoal": 2,
"bufferingGoal": 10,
"bufferBehind": 30,
"ignoreTextStreamFailures": false,
"alwaysStreamText": false,
"startAtSegmentBoundary": false,
"gapDetectionThreshold": 0.1,
"smallGapLimit": 0.5,
"jumpLargeGaps": false,
"durationBackoff": 1,
"forceTransmuxTS": false,
"safeSeekOffset": 5,
"stallEnabled": true,
"stallThreshold": 1,
"stallSkip": 0.1,
"useNativeHlsOnSafari": true,
"inaccurateManifestTolerance": 2,
"lowLatencyMode": false,
"autoLowLatencyMode": false,
"forceHTTPS": false,
"preferNativeHls": false
},
"offline": {
"usePersistentLicense": true
},
"abr": {
"enabled": true,
"useNetworkInformation": true,
"defaultBandwidthEstimate": 1000000,
"switchInterval": 8,
"bandwidthUpgradeTarget": 0.85,
"bandwidthDowngradeTarget": 0.95,
"restrictions": {
"minWidth": 0,
"maxWidth": null,
"minHeight": 0,
"maxHeight": null,
"minPixels": 0,
"maxPixels": null,
"minFrameRate": 0,
"maxFrameRate": null,
"minBandwidth": 0,
"maxBandwidth": 1400000
}
},
"preferredAudioLanguage": "",
"preferredTextLanguage": "",
"preferredVariantRole": "",
"preferredTextRole": "",
"preferredAudioChannelCount": 2,
"preferForcedSubs": false,
"restrictions": {
"minWidth": 0,
"maxWidth": null,
"minHeight": 0,
"maxHeight": null,
"minPixels": 0,
"maxPixels": null,
"minFrameRate": 0,
"maxFrameRate": null,
"minBandwidth": 0,
"maxBandwidth": null
},
"playRangeStart": 0,
"playRangeEnd": null,
"useMediaCapabilities": false
}"

What did you do?

Enabling a maximum Bandwidth via the abr config
abr: { enabled: true, restrictions: { maxBandwidth: 1400000 } }

What did you expect to happen?
Video player loading lower quality segments with a bandwidth not exceeding the configured limit

What actually happened?

For Chrome/Dash only low quality segments get loaded according to the configuration.

Screenshot 2021-06-24 at 12 16 44

Unfortunately when playing on Safari/Hls the configured bandwidth limit seems to be ignored.

Screenshot 2021-06-24 at 12 13 54

@theodab
Copy link
Collaborator

theodab commented Jun 24, 2021

I see from your configuration that the streaming.useNativeHlsOnSafari configuration value is set to true. Because of that, Shaka Player will leave playing HLS content completely to the browser on Safari... and in that case, we can no longer apply bandwidth limits. You should try setting it to false instead; setting it to true is mostly useful for Fairplay support, I think.

@theodab theodab added status: working as intended The behavior is intended; this is not a bug component: HLS The issue involves Apple's HLS manifest format labels Jun 24, 2021
@saringer
Copy link
Author

saringer commented Jun 24, 2021

When setting the value for streaming.useNativeHlsOnSafari to false I'm receiving an error with code 4032 (CONTENT_UNSUPPORTED_BY_BROWSER).

setting it to true is mostly useful for Fairplay support, I think.

We probably will have to implement Fairplay which will not work if streaming.useNativeHlsOnSafari is set to false,if I am not mistaken?

@theodab
Copy link
Collaborator

theodab commented Jun 25, 2021

CONTENT_UNSUPPORTED_BY_BROWSER means that all of the streams within the manifest are unplayable... either because no streams meet the restrictions, or because we didn't get DRM keys for the streams. When you say that you got that error, was it with the assets you sent us, or a different one? I tried playing the manifest you provided in Safari, using MediaSource playback, and both of them seemed to work fine.

As for Fairplay... for a long time, the documentation on how to use Fairplay in MSE was very sparse. Because of that, at the moment, we have to leave Fairplay entirely to the browser.
Apple has improved their documentation, so we probably have enough information now to add actual Fairplay support, so that we can handle it in non-iOS Safari. But we haven't had time to get to that, yet.
See: #3346

@saringer
Copy link
Author

When you say that you got that error, was it with the assets you sent us, or a different one?

Yes, I received the error with the provided assets, which are DRM free.

@TheModMaker
Copy link
Contributor

I see an .aac file, which we don't support yet (see #2615). So you either need to get content with TS or MP4 audio, or play using native playback.

@saringer
Copy link
Author

I see, thank you :)

@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Aug 28, 2021
@shaka-project shaka-project locked and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated status: working as intended The behavior is intended; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants