Add robustness suggestions for Widevine#1008
Add robustness suggestions for Widevine#1008joeyparrish merged 3 commits intoshaka-project:masterfrom
Conversation
theodab
left a comment
There was a problem hiding this comment.
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
|
|
||
|
|
||
| /** @private */ | ||
| shakaDemo.updateRobustnessSuggestions_ = function() { |
There was a problem hiding this comment.
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.
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.
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
| 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.
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.
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? |
joeyparrish
left a comment
There was a problem hiding this comment.
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.