PlaybackSessionInterfaceAVKit.h [plain text]
#pragma once
#if PLATFORM(COCOA)
#include "EventListener.h"
#include "HTMLMediaElementEnums.h"
#include "PlaybackSessionModel.h"
#include "Timer.h"
#include <functional>
#include <objc/objc.h>
#include <wtf/Forward.h>
#include <wtf/Ref.h>
#include <wtf/RefCounted.h>
#include <wtf/RetainPtr.h>
#include <wtf/WeakPtr.h>
OBJC_CLASS WebAVPlayerController;
namespace WebCore {
class IntRect;
class PlaybackSessionModel;
class WebPlaybackSessionChangeObserver;
class WEBCORE_EXPORT PlaybackSessionInterfaceAVKit
: public PlaybackSessionModelClient
, public RefCounted<PlaybackSessionInterfaceAVKit> {
public:
static Ref<PlaybackSessionInterfaceAVKit> create(PlaybackSessionModel& model)
{
return adoptRef(*new PlaybackSessionInterfaceAVKit(model));
}
virtual ~PlaybackSessionInterfaceAVKit();
PlaybackSessionModel* playbackSessionModel() const;
void durationChanged(double) override;
void currentTimeChanged(double currentTime, double anchorTime) override;
void bufferedTimeChanged(double) override;
void rateChanged(bool isPlaying, float playbackRate) override;
void seekableRangesChanged(const TimeRanges&, double lastModifiedTime, double liveUpdateInterval) override;
void canPlayFastReverseChanged(bool) override;
void audioMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override;
void legibleMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override;
void externalPlaybackChanged(bool enabled, PlaybackSessionModel::ExternalPlaybackTargetType, const String& localizedDeviceName) override;
void wirelessVideoPlaybackDisabledChanged(bool) override;
void mutedChanged(bool) override;
void volumeChanged(double) override;
void modelDestroyed() override;
void invalidate();
WebAVPlayerController *playerController() const { return m_playerController.get(); }
private:
PlaybackSessionInterfaceAVKit(PlaybackSessionModel&);
RetainPtr<WebAVPlayerController> m_playerController;
PlaybackSessionModel* m_playbackSessionModel { nullptr };
};
}
#endif // PLATFORM(COCOA)