mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 17:29:01 +00:00
LibWeb/EME: Implement is_supported_key_system
This commit is contained in:
parent
7b9d5f9fdc
commit
c9b3365286
Notes:
github-actions[bot]
2025-08-27 07:59:16 +00:00
Author: https://github.com/stelar7
Commit: c9b3365286
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5665
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/trflynn89
2 changed files with 22 additions and 0 deletions
|
@ -399,4 +399,24 @@ Optional<ConsentConfiguration> get_supported_configuration(KeySystem const& impl
|
|||
return supported_configuration;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/encrypted-media/#dfn-common-key-systems
|
||||
bool is_supported_key_system(Utf16String const& key_system)
|
||||
{
|
||||
constexpr Array<Utf16View, 1> supported_key_systems = {
|
||||
// https://w3c.github.io/encrypted-media/#clear-key
|
||||
"org.w3.clearkey"sv,
|
||||
};
|
||||
|
||||
return supported_key_systems.contains_slow(key_system);
|
||||
}
|
||||
|
||||
NonnullOwnPtr<KeySystem> key_system_from_string(Utf16String const& key_system)
|
||||
{
|
||||
if (key_system == "org.w3.clearkey"_utf16) {
|
||||
return adopt_own(*new ClearKeySystem());
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ namespace Web::EncryptedMediaExtensions {
|
|||
|
||||
bool supports_container(Utf16String const& container);
|
||||
bool is_persistent_session_type(Utf16String const& session_type);
|
||||
bool is_supported_key_system(Utf16String const& key_system);
|
||||
NonnullOwnPtr<KeySystem> key_system_from_string(Utf16String const& key_system);
|
||||
ConsentStatus get_consent_status(Bindings::MediaKeySystemConfiguration const&, MediaKeyRestrictions&, URL::Origin const&);
|
||||
Optional<Vector<Bindings::MediaKeySystemMediaCapability>> get_supported_capabilities_for_audio_video_type(KeySystem const&, CapabilitiesType, Vector<Bindings::MediaKeySystemMediaCapability>, Bindings::MediaKeySystemConfiguration, MediaKeyRestrictions);
|
||||
Optional<ConsentConfiguration> get_supported_configuration_and_consent(KeySystem const&, Bindings::MediaKeySystemConfiguration const&, MediaKeyRestrictions&, URL::Origin const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue