Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ContentPlaybackController.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef DOM_MEDIA_MEDIACONTROL_CONTENTPLAYBACKCONTROLLER_H_
#define DOM_MEDIA_MEDIACONTROL_CONTENTPLAYBACKCONTROLLER_H_

#include "MediaControlKeySource.h"
#include "mozilla/dom/BrowsingContext.h"
#include "nsPIDOMWindow.h"

namespace mozilla::dom {

class MediaSession;

/**
 * This interface is used to handle different playback control actions in the
 * content process. Most of the methods are designed based on the
 * MediaSessionAction values, which are defined in the media session spec [1].
 *
 * The reason we need that is to explicitly separate the implementation from all
 * different defined methods. If we want to add a new method in the future, we
 * can do that without modifying other methods.
 *
 * If the active media session has a corresponding MediaSessionActionHandler,
 * then we would invoke it, or we would do nothing. However, for certain
 * actions, such as `play`, `pause` and `stop`, we have default action handling
 * in order to control playback correctly even if the website doesn't use media
 * session at all or the media session doesn't have correspending action handler
 * [2].
 *
 * [1] https://w3c.github.io/mediasession/#enumdef-mediasessionaction
 * [2]
 * https://w3c.github.io/mediasession/#ref-for-active-media-session%E2%91%A1%E2%93%AA
 */

class MOZ_STACK_CLASS ContentPlaybackController {
 public:
  explicit ContentPlaybackController(BrowsingContext* aContext);
  ~ContentPlaybackController() = default;

  // TODO: Convert Focus() to MOZ_CAN_RUN_SCRIPT
  MOZ_CAN_RUN_SCRIPT_BOUNDARY void Focus();
  void Play();
  void Pause();
  void SeekBackward(double aSeekOffset);
  void SeekForward(double aSeekOffset);
  void PreviousTrack();
  void NextTrack();
  void SkipAd();
  void Stop();
  void SeekTo(double aSeekTime, bool aFastSeek);
  void SetVolume(double aVolume);
  void Mute();
  void Unmute();

 private:
  void NotifyContentMediaControlKeyReceiver(
      MediaControlKey aKey, const MediaControlActionParams& aParams = {});
  void NotifyMediaSession(MediaSessionAction aAction);
  void NotifyMediaSession(const MediaSessionActionDetails& aParams);
  void NotifyMediaSessionWhenActionIsSupported(MediaSessionAction aAction);
  bool IsMediaSessionActionSupported(MediaSessionAction aAction) const;
  Maybe<uint64_t> GetActiveMediaSessionId() const;
  MediaSession* GetMediaSession() const;

  RefPtr<BrowsingContext> mBC;
};

class ContentMediaControlKeyHandler {
 public:
  static void HandleMediaControlAction(BrowsingContext* aContext,
                                       const MediaControlAction& aAction);
};

}  // namespace mozilla::dom

#endif

Messung V0.5 in Prozent
C=90 H=100 G=95

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002