[webkit-dev] phonon and qtwebkit modifications to make it work

Adam Barth abarth at webkit.org
Mon Jul 4 11:51:37 PDT 2011


Please file a bug and attach a patch for review.  We cannot accept code via
the mailing list for legal reasons.

Adam


On Mon, Jul 4, 2011 at 11:04 AM, Mihai Adrian <mihaiadriangl at yahoo.com>wrote:

> Hello,
>
> I use an older version of qtwebkit, but no modification have been done in
> the phonon backend part ( MediaPlayerPrivatePhonon.h,
> MediaPlayerPrivatePhonon.cpp) . I made the following modification to allow
> HTML5 audio/video make it work with phonon:
>
> MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
>     : m_player(player)
>     , m_networkState(MediaPlayer::Empty)
>     , m_readyState(MediaPlayer::HaveNothing)
>     , m_mediaObject(new MediaObject())
>     , m_videoWidget(new VideoWidget(0))
>     , m_audioOutput(new AudioOutput())
>     , m_isVisible(false)
> {
>
> ........
>
>     QTimer::singleShot(100, m_videoWidget, SLOT(show()));  //let event loop
> bread
>
>   // this is needed for m_videoWidget to catch setting attribute
>   // Qt::WA_DontShowOnScreen .  m_videoWidget will not be shown on the
> screen
>   // but will act as a shown widget. This is needed to be rendered in a
> QPainter.
>
>     m_firstTime = true;
> }
>
>
> / /Only this method is called when clicking on the play/pause button, so
> the
> // logic for play/pause must be implemented here
> // webkit calls this function evrey time page loads, so first call is
> discarded.
>
> void MediaPlayerPrivate::pause()
> {
>   if (m_firstTime)
>   {
>     m_firstTime = false;
>     return;
>   }
>
>   if ( m_mediaObject->state() != Phonon::PlayingState )
>   {
>     if (m_mediaObject->currentTime() == m_mediaObject->totalTime())
>     {
>         LOG(Media, "MediaPlayerPrivatePhonon::seek(0)");
>         m_mediaObject->seek(0);
>     }
>
>     LOG(Media, "MediaPlayerPrivatePhonon::play()");
>     m_mediaObject->play();
>   }
>   else
>   {
>     LOG(Media, "MediaPlayerPrivatePhonon::pause()");
>     m_mediaObject->pause();
>   }
> }
>
> Without this modifications, HTML5 video doesn't work with phonon. What do
> you think about ?
>
> Thank you,
> Mihai Adrian
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110704/cff54740/attachment.html>


More information about the webkit-dev mailing list