-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add robustness suggestions for Widevine #1008
Add robustness suggestions for Widevine #1008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little sad this can only happen after actually loading the asset, rather than after selecting the asset but before loading it. That wouldn't be possible, though, because this works by checking loaded data from the player. We could check the tags on the default assets to see if they contain Widevine, but none of the default assets require robustness configuration.
Anyway, LGTM.
demo/configuration_section.js
Outdated
@@ -55,6 +55,25 @@ shakaDemo.setupConfiguration_ = function() { | |||
|
|||
|
|||
/** @private */ | |||
shakaDemo.updateRobustnessSuggestions_ = function() { | |||
var drmInfo = shakaDemo.player_.drmInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the idea, but this won't work as you would expect.
drmInfo() returns info about the currently-loaded stream. Before you load anything, it returns null.
The robustness settings, however, have no immediate effect. They effect the next content you load.
So using the key system of the current content to decide what values to suggest for the next content is not going to work the way it should in all cases.
An alternative would be to detect what key systems are supported by the browser, and suggest all known robustness settings for all supported key systems. (Currently, the only key system with well-known values is Widevine, but we hope to see that change.)
@joeyparrish I've tried your approach in feb1d87. WDYT? |
demo/index.html
Outdated
</div> | ||
<input id="drmSettingsAudioRobustness" type="text" class="flex-grow" list="robustnessSuggestions"> | ||
</div> | ||
<datalist id="robustnessSuggestions"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I would like to use this, caniuse says it is not well supported in all the browsers we support. You'll probably need to do this in JavaScript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will probably be fine.
The only browser with no support on that list is Safari, at which point Safari behaves the same as it did before.
Partial support on Firefox refers to text fields only, which works here.
Partial support on IE/Edge is a little more concerning, since it seems that some events may not fire. But if we don't need those events, it may still work. (I don't think we need change events on these fields.)
demo/asset_section.js
Outdated
@@ -57,6 +58,14 @@ shakaDemo.setupAssets_ = function() { | |||
if (asset.drm.length && !asset.drm.some( | |||
function(keySystem) { return shakaDemo.support_.drm[keySystem]; })) { | |||
option.disabled = true; | |||
asset.drm.forEach(function(keySystem) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joey's suggestion was to use the drm probe to detect browser support. asset.drm
is the key systems available in the asset. You can use shakaDemo.support_.drm[keySystem]
to detect if it is supported on the browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. We are less interested in what key systems the selected asset uses. If the "custom" field is used, we don't know. But if the browser supports Widevine, it is reasonable to suggest Widevine-specific values here regardless of what asset is selected.
f97821a
to
c8b5c07
Compare
@TheModMaker @joeyparrish WDYT of c8b5c07? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Sorry for the delay. I'll run it through the build bot one more time.
All tests passed! |
Cherry-picked to v2.2.3. |
This PR adds suggestions for audio and video robustness fields which may be obscure to newcomers especially if they didn't read https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html yet.