Auto merge of #23216 - ferjm:replay, r=ceyusa

Allow replaying media

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23216)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-04-17 06:18:14 -04:00 committed by GitHub
commit 5efd57b7bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1708,8 +1708,12 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
}
// Step 5.
// FIXME(nox): Seek to earliest possible position if playback has ended
// and direction of playback is forwards.
if self.Ended() && self.direction_of_playback() == PlaybackDirection::Forwards {
self.seek(
self.earliest_possible_position(),
/* approximate_for_speed */ false,
);
}
let state = self.ready_state.get();