Bug 138657 - Video as image
Summary: Video as image
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-12 06:31 PST by Antti Koivisto
Modified: 2015-01-21 13:55 PST (History)
6 users (show)

See Also:


Attachments
wip patch (19.88 KB, patch)
2014-11-12 06:32 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
wip, rebased and with actual mime type handling (20.16 KB, patch)
2014-11-12 15:42 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
attempt to use media source extensions (27.15 KB, patch)
2015-01-21 13:55 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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