Search in sources :

Example 1 with ActivityContentVideoViewEmbedder

use of org.chromium.content.browser.ActivityContentVideoViewEmbedder in project AndroidChromium by JackyAndroid.

the class TabWebContentsDelegateAndroid method getContentVideoViewEmbedder.

@Override
public ContentVideoViewEmbedder getContentVideoViewEmbedder() {
    return new ActivityContentVideoViewEmbedder(mTab.getActivity()) {

        @Override
        public void enterFullscreenVideo(View view, boolean isVideoLoaded) {
            super.enterFullscreenVideo(view, isVideoLoaded);
            FullscreenManager fullscreenManager = mTab.getFullscreenManager();
            if (fullscreenManager != null) {
                fullscreenManager.setOverlayVideoMode(true);
                // Disable double tap for video.
                ContentViewCore cvc = mTab.getContentViewCore();
                if (cvc != null) {
                    cvc.updateDoubleTapSupport(false);
                }
            }
        }

        @Override
        public void exitFullscreenVideo() {
            FullscreenManager fullscreenManager = mTab.getFullscreenManager();
            if (fullscreenManager != null) {
                fullscreenManager.setOverlayVideoMode(false);
                // Disable double tap for video.
                ContentViewCore cvc = mTab.getContentViewCore();
                if (cvc != null) {
                    cvc.updateDoubleTapSupport(true);
                }
            }
            super.exitFullscreenVideo();
        }
    };
}
Also used : FullscreenManager(org.chromium.chrome.browser.fullscreen.FullscreenManager) ContentViewCore(org.chromium.content.browser.ContentViewCore) ActivityContentVideoViewEmbedder(org.chromium.content.browser.ActivityContentVideoViewEmbedder) View(android.view.View)

Aggregations

View (android.view.View)1 FullscreenManager (org.chromium.chrome.browser.fullscreen.FullscreenManager)1 ActivityContentVideoViewEmbedder (org.chromium.content.browser.ActivityContentVideoViewEmbedder)1 ContentViewCore (org.chromium.content.browser.ContentViewCore)1