/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class HTMLMediaElement; class AudioContext; class Document; enumclass AutoplayPolicy : uint8_t; enumclass AutoplayPolicyMediaType : uint8_t;
} // namespace mozilla::dom
namespace mozilla::media { /** *AutoplayPolicyisusedtomanageautoplaylogicforallkindsofmedia, *includingMediaElement,WebAudioandWebSpeech. * *Autoplaycouldbedisablebysettingthepref"media.autoplay.default" *toanythingbutnsIAutoplay::Allowed.Onceuserdisablesautoplay,media *couldonlybeplayedifoneoffollowingconditionsistrue. *1)Ownerdocumentisactivatedbyusergestures *Werestrictusergesturesto"mouseclick","keyboardpress"and"touch". *2)Mutedmediacontentorvideowithoutaudiocontent. *3)Document'soriginhasthe"autoplay-media"permission.
*/ class AutoplayPolicy {
public: // Returns whether a given media element is allowed to play. staticbool IsAllowedToPlay(const dom::HTMLMediaElement& aElement);
// Returns whether a given AudioContext is allowed to play. staticbool IsAllowedToPlay(const dom::AudioContext& aContext);
// Return the value of the autoplay permission for given principal. The return // value can be 0=unknown, 1=allow, 2=block audio, 5=block audio and video. static uint32_t GetSiteAutoplayPermission(nsIPrincipal* aPrincipal);
// Following methods are used for the internal implementation for the Autoplay // Policy Detection API, the public JS interfaces are in exposed on Navigator. // https://w3c.github.io/autoplay/#autoplay-detection-methods static dom::AutoplayPolicy GetAutoplayPolicy( const dom::HTMLMediaElement& aElement);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.