Bug 138657

Summary: Video as image
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, cdumez, dino, eric.carlson, jonlee, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
wip patch
none
wip, rebased and with actual mime type handling
none
attempt to use media source extensions none

Description Antti Koivisto 2014-11-12 06:31:57 PST
Support real video formats wherever images are allowed (<img>, CSS backgrounds, etc.) Semantics like animated GIF.
Comment 1 Antti Koivisto 2014-11-12 06:32:40 PST
Created attachment 241422 [details]
wip patch
Comment 2 Eric Carlson 2014-11-12 10:17:48 PST
Comment on attachment 241422 [details]
wip patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241422&action=review

Nice!

> Source/WebCore/platform/graphics/VideoImage.cpp:84
> +    if (m_player->readyState() >= MediaPlayer::HaveEnoughData)
> +        m_frameTimer.startOneShot(16_ms);
> +
> +    if (m_player->duration() > MediaTime::zeroTime() && m_player->currentTime() >= m_player->duration()) {
> +        fprintf(stderr, "seeking %d\n", m_player->readyState());
> +        m_player->seek(MediaTime::zeroTime());
> +    }

It seems like we should seek to the next frame if possible instead of using a hard coded interval. How about adding MediaPlayer::step(int numberOfFrames) - and have the default MediaPlayerPrivate implementation seek 16_ms * numberOfFrames so it works like this does until ports implement stepping logic?
Comment 3 Antti Koivisto 2014-11-12 15:28:21 PST
> It seems like we should seek to the next frame if possible instead of using
> a hard coded interval. How about adding MediaPlayer::step(int
> numberOfFrames) - and have the default MediaPlayerPrivate implementation
> seek 16_ms * numberOfFrames so it works like this does until ports implement
> stepping logic?

Makes sense. I was actually trying to find a "new frame available" callback so the media player could drive the paints. MediaPlayerClient::mediaPlayerRepaint sounded like it but it didn't seem to actually get called. The timer was more of a hack.
Comment 4 Antti Koivisto 2014-11-12 15:42:16 PST
Created attachment 241448 [details]
wip, rebased and with actual mime type handling
Comment 5 Antti Koivisto 2015-01-21 13:55:34 PST
Created attachment 245080 [details]
attempt to use media source extensions