mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb/EME: Implement is_supported_key_system
This commit is contained in:
parent
7b9d5f9fdc
commit
c9b3365286
|
|
@ -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…
Reference in New Issue
Block a user