void FullScreenVideoHandler::enterFullScreen(QMediaPlayer* player) { Q_ASSERT(player); m_mediaWidget = new FullScreenVideoWidget(player); connect(m_mediaWidget, SIGNAL(fullScreenClosed()), this, SIGNAL(fullScreenClosed())); m_mediaWidget->showFullScreen(); }
DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler() : QWebFullScreenVideoHandler() , m_fullScreenWidget(new FullScreenVideoWidget) { connect(m_fullScreenWidget, SIGNAL(didExitFullScreen()), this, SIGNAL(fullScreenClosed())); m_fullScreenWidget->hide(); m_fullScreenWidget->close(); }
bool FullScreenVideoWidget::event(QEvent* ev) { if (ev->type() == QEvent::MouseButtonDblClick) { emit fullScreenClosed(); ev->accept(); return true; } return QWidget::event(ev); }
void HTML5FullScreenVideoHandler::enterFullScreen(QMediaPlayer *player) { if (!player) return; m_videoWidget = new HTML5VideoWidget(); if (!m_videoWidget) return; m_videoWidget->setDuration(player->duration() / 1000); CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); if (appUi) { m_savedOrientation = appUi->Orientation(); appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape); } m_mediaPlayer = player; connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)), m_videoWidget, SLOT(onPositionChanged(qint64))); connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)), m_videoWidget, SLOT(setDuration(qint64))); connect(m_mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onPlayerStateChanged(QMediaPlayer::State))); connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(onPlayerError(QMediaPlayer::Error))); connect(m_mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus))); connect(m_videoWidget, SIGNAL(positionChangedByUser(qint64)), m_mediaPlayer, SLOT(setPosition(qint64))); connect(m_videoWidget, SIGNAL(closeClicked()), this, SIGNAL(fullScreenClosed())); connect(m_videoWidget, SIGNAL(muted(bool)), m_mediaPlayer, SLOT(setMuted(bool))); connect(m_videoWidget, SIGNAL(volumeChanged(int)), m_mediaPlayer, SLOT(setVolume(int))); connect(m_videoWidget, SIGNAL(pauseClicked()), m_mediaPlayer, SLOT(pause())); connect(m_videoWidget, SIGNAL(playClicked()), m_mediaPlayer, SLOT(play())); m_mediaPlayer->setVideoOutput(m_videoWidget); m_videoWidget->setVolume(m_mediaPlayer->volume()); m_videoWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); m_videoWidget->showFullScreen(); m_fullScreen = true; // Handle current Media Status and Media Player error. onMediaStatusChanged(m_mediaPlayer->mediaStatus()); onPlayerError(m_mediaPlayer->error()); }
FullScreenVideoQt::FullScreenVideoQt(ChromeClientQt* chromeClient) : m_chromeClient(chromeClient) , m_videoElement(0) { Q_ASSERT(m_chromeClient); #if USE(QT_MULTIMEDIA) m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler(); if (!m_FullScreenVideoHandler) m_FullScreenVideoHandler = new DefaultFullScreenVideoHandler; if (m_FullScreenVideoHandler) connect(m_FullScreenVideoHandler, SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose())); #endif #if USE(GSTREAMER) m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler; #endif #if USE(QTKIT) m_FullScreenVideoHandlerQTKit = new QTKitFullScreenVideoHandler; #endif }