Bug 95986 - Seek to end after duration change in HTMLMediaElement
Summary: Seek to end after duration change in HTMLMediaElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Victoria Kirst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-06 08:24 PDT by Victoria Kirst
Modified: 2012-09-07 18:28 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.76 KB, patch)
2012-09-06 08:30 PDT, Victoria Kirst
no flags Details | Formatted Diff | Diff
Patch (6.66 KB, patch)
2012-09-07 02:10 PDT, Victoria Kirst
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victoria Kirst 2012-09-06 08:24:26 PDT
Seek to end after duration change in HTMLMediaElement
Comment 1 Victoria Kirst 2012-09-06 08:30:08 PDT
Created attachment 162513 [details]
Patch
Comment 2 Eric Carlson 2012-09-06 11:01:45 PDT
Comment on attachment 162513 [details]
Patch

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

> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:13
> +                waitForEventOnce('loadeddata', onLoadedData, false, false, video);

waitForEventOnce only takes three parameters, what are the last two intended to do?

> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:20
> +                waitForEventOnce('seeked', onExplicitSeek, false, false, video);

Ditto.

> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:32
> +                waitForEventOnce('durationchange', onDurationChange, false, false, video);

Ditto.

> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:42
> +                waitForEventOnce('seeking', function() {
> +                    waitForEventOnce('seeked', onSeekToEnd, false, false, video);
> +                    mediaSource.endOfStream();
> +                }, false, false, video);

Ditto.

> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:50
> +                    failTest("Seeked to " + currentTime.toFixed(3) + " instead of " + duration.toFixed(3));

You compare currenTime and duration with full precision so the error message should do the same.
Comment 3 Victoria Kirst 2012-09-07 02:10:39 PDT
Created attachment 162713 [details]
Patch
Comment 4 Victoria Kirst 2012-09-07 02:12:27 PDT
Comment on attachment 162513 [details]
Patch

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

>> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:13
>> +                waitForEventOnce('loadeddata', onLoadedData, false, false, video);
> 
> waitForEventOnce only takes three parameters, what are the last two intended to do?

Whoops; originally I had used waitForEvent() (which has 5 parameters -- the 4th is for "run one time", and the 5th is the element on which the event listener is attached), then realized I wanted waitForEventOnce() and didn't remove the last two parameters.

Since I always attach the event listener to "video," the waitForEventOnce() 3-parameter method works. Changed all callsites.

>> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:20
>> +                waitForEventOnce('seeked', onExplicitSeek, false, false, video);
> 
> Ditto.

Fixed.

>> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:32
>> +                waitForEventOnce('durationchange', onDurationChange, false, false, video);
> 
> Ditto.

Fixed.

>> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:42
>> +                }, false, false, video);
> 
> Ditto.

Fixed, here and a few lines above.

>> LayoutTests/http/tests/media/media-source/seek-to-end-after-duration-change.html:50
>> +                    failTest("Seeked to " + currentTime.toFixed(3) + " instead of " + duration.toFixed(3));
> 
> You compare currenTime and duration with full precision so the error message should do the same.

Done.
Comment 5 WebKit Review Bot 2012-09-07 18:28:22 PDT
Comment on attachment 162713 [details]
Patch

Clearing flags on attachment: 162713

Committed r127949: <http://trac.webkit.org/changeset/127949>
Comment 6 WebKit Review Bot 2012-09-07 18:28:24 PDT
All reviewed patches have been landed.  Closing bug.