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

Andreas Kling kling at webkit.org
Mon Jul 4 11:57:23 PDT 2011


Hiya,

The Phonon implementation of MediaPlayer was removed from WebKit in
https://bugs.webkit.org/show_bug.cgi?id=63448

-Kling

On Mon, Jul 4, 2011 at 8:04 PM, 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/6a6c4547/attachment.html>


More information about the webkit-dev mailing list