WebVideoFullscreenInterfaceAVKit.h [plain text]
#ifndef WebVideoFullscreenInterfaceAVKit_h
#define WebVideoFullscreenInterfaceAVKit_h
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
#include <WebCore/EventListener.h>
#include <WebCore/HTMLMediaElement.h>
#include <WebCore/PlatformLayer.h>
#include <WebCore/WebVideoFullscreenInterface.h>
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
OBJC_CLASS WebAVPlayerController;
OBJC_CLASS AVPlayerViewController;
OBJC_CLASS UIViewController;
OBJC_CLASS UIWindow;
OBJC_CLASS UIView;
OBJC_CLASS CALayer;
OBJC_CLASS WebAVVideoLayer;
namespace WebCore {
class WebVideoFullscreenModel;
class WebVideoFullscreenChangeObserver {
public:
virtual ~WebVideoFullscreenChangeObserver() { };
virtual void didSetupFullscreen() = 0;
virtual void didEnterFullscreen() = 0;
virtual void didExitFullscreen() = 0;
virtual void didCleanupFullscreen() = 0;
};
class WebVideoFullscreenInterfaceAVKit
: public WebVideoFullscreenInterface
, public RefCounted<WebVideoFullscreenInterfaceAVKit> {
RetainPtr<WebAVPlayerController> m_playerController;
RetainPtr<AVPlayerViewController> m_playerViewController;
RetainPtr<CALayer> m_videoLayer;
RetainPtr<WebAVVideoLayer> m_videoLayerContainer;
WebVideoFullscreenModel* m_videoFullscreenModel;
WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver;
RetainPtr<UIWindow> m_window;
RetainPtr<UIViewController> m_viewController;
RetainPtr<UIView> m_parentView;
WebAVPlayerController *playerController();
void doEnterFullscreen();
public:
WebVideoFullscreenInterfaceAVKit();
virtual ~WebVideoFullscreenInterfaceAVKit() { }
void setWebVideoFullscreenModel(WebVideoFullscreenModel*);
void setWebVideoFullscreenChangeObserver(WebVideoFullscreenChangeObserver*);
virtual void setDuration(double) override;
virtual void setCurrentTime(double currentTime, double anchorTime) override;
virtual void setRate(bool isPlaying, float playbackRate) override;
virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
virtual void setSeekableRanges(const TimeRanges&) override;
virtual void setCanPlayFastReverse(bool) override;
virtual void setAudioMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) override;
virtual void setLegibleMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) override;
virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String localizedDeviceName) override;
virtual void setupFullscreen(PlatformLayer&, WebCore::IntRect initialRect, UIView *);
virtual void enterFullscreen();
virtual void exitFullscreen(WebCore::IntRect finalRect);
virtual void cleanupFullscreen();
virtual void invalidate();
virtual void requestHideAndExitFullscreen();
};
}
#endif
#endif