Commit d7625e64 authored by philipj@opera.com's avatar philipj@opera.com

Count how often a Media Fragments URI is applied in HTMLMediaElement

http://lists.w3.org/Archives/Public/public-media-fragment/2014Feb/0000.html
http://lists.w3.org/Archives/Public/public-media-fragment/2014Feb/0002.html

In this thread about looping over media fragments it became clear that
no spec actually says how media fragment end times integrate in
HTMLMediaElement. (The start time is mapped to the "initial playback
position", which almost matches what Blink does.)

Blink/WebKit pauses at the fragment end time once. Firefox Nightly does
the same, while IE11 appears to not support MF URIs at all.

The counter data will tell us whether or not breaking changes can be
made and the relative usage could help inform the spec discussion.

BUG=none
R=acolwell@chromium.org

Review URL: https://codereview.chromium.org/185363002

git-svn-id: svn://svn.chromium.org/blink/trunk@168441 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 49a4c3b8
...@@ -299,6 +299,8 @@ public: ...@@ -299,6 +299,8 @@ public:
InsertAdjacentHTML = 278, InsertAdjacentHTML = 278,
SVGClassName = 279, SVGClassName = 279,
HTMLAppletElement = 280, HTMLAppletElement = 280,
HTMLMediaElementSeekToFragmentStart = 281,
HTMLMediaElementPauseAtFragmentEnd = 282,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
NumberOfFeatures, // This enum value must be last. NumberOfFeatures, // This enum value must be last.
......
...@@ -2441,6 +2441,7 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) ...@@ -2441,6 +2441,7 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fragmentEndTime && m_playbackRate > 0) { if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fragmentEndTime && m_playbackRate > 0) {
m_fragmentEndTime = MediaPlayer::invalidTime(); m_fragmentEndTime = MediaPlayer::invalidTime();
if (!m_mediaController && !m_paused) { if (!m_mediaController && !m_paused) {
UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFragmentEnd);
// changes paused to true and fires a simple event named pause at the media element. // changes paused to true and fires a simple event named pause at the media element.
pause(); pause();
} }
...@@ -3884,6 +3885,7 @@ void HTMLMediaElement::applyMediaFragmentURI() ...@@ -3884,6 +3885,7 @@ void HTMLMediaElement::applyMediaFragmentURI()
{ {
if (m_fragmentStartTime != MediaPlayer::invalidTime()) { if (m_fragmentStartTime != MediaPlayer::invalidTime()) {
m_sentEndEvent = false; m_sentEndEvent = false;
UseCounter::count(document(), UseCounter::HTMLMediaElementSeekToFragmentStart);
seek(m_fragmentStartTime, IGNORE_EXCEPTION); seek(m_fragmentStartTime, IGNORE_EXCEPTION);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment