Commit graph

200 commits

Author SHA1 Message Date
Fernando Jiménez Moreno
9aced067aa Reset seeking flag if stream is not seekable 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
34c1f2587f Add fetch canceller to HTMLMediaElementFetchContext and clarify how we restart after a backoff 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
e7e390ee8e Backoff protocol for media fetch requests 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
f1d012d782 Make sure that we ignore responses from old requests 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
c8806767a0 Set media stream as seekable only if the server supports range requests 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
5112e0435c Update servo-media 2019-01-10 19:09:32 +01:00
Fernando Jiménez Moreno
f7eeb26f0a Force the usage of mp4 for media-element WPTs 2019-01-09 09:28:43 +01:00
Fernando Jiménez Moreno
6c2c3f75b9 Implement step 6 of media element 'time marches on' algoritm 2019-01-09 09:28:42 +01:00
Manish Goregaokar
4328fc23a7 Clean up HTMLMediaElement::Play 2019-01-04 15:05:07 -08:00
Manish Goregaokar
611dc4bc70 Remove now-unnecessary must_root and allow(unrooted_must_root) annotations 2019-01-04 15:05:07 -08:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
George Roman
deb02ab6d7 Implement HTMLMediaElement defaultPlaybackRate and playbackRate attributes 2018-12-26 22:20:51 +02:00
Dan Robertson
c46508e497
Update src/href attributes to be a USVString
The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

 - HTMLIFrameElement
 - HTMLImageElement
 - HTMLInputElement
 - HTMLLinkElement
 - HTMLMediaElement
 - HTMLScriptElement
2018-12-17 15:28:42 +00:00
bors-servo
eab848df3e
Auto merge of #22433 - ferjm:player.eos.size, r=ceyusa
Improve implementation of media resource fetch algorithm

I have been observing inconsistent behaviors with my local tests depending of the media asset being played. I figured that we had these issues:

- We were setting the player EOS as soon as we got the first [process_response_eof](1046ae58a1/components/script/dom/htmlmediaelement.rs (L1596)). This is fine only if there is a single request. But that's not the case for multiple range requests or for seeks. Setting the player EOS makes the player appsrc reject any new buffers, and that breaks playback. Figuring out when is the right time to set the player EOS won't be a straight forward task, so my suggested fix for now is to simply not set it for now. It is a cleanup step that it would be nice to have but it is not mandatory.

- We were setting the input size more than once for multiple range requests and with the incorrect value. The fix uses the `content-length` or the `content-range` headers for single and range requests respectively.

- We were moving to the HaveEnoughData state if a fetch request succeded but no data was fetched from the network.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/22433)
<!-- Reviewable:end -->
2018-12-12 18:38:25 -05:00
Fernando Jiménez Moreno
8818898240 Do not move to HaveEnoughData state if no media data is fetched from the network 2018-12-12 18:08:40 +01:00
Fernando Jiménez Moreno
707b490c0f Signal EOS if media request fails 2018-12-12 16:52:37 +01:00
Lucas Fantacuci
ad3ec61d2f Implementing volume attribute into HTMLMediaElement 2018-12-12 11:50:35 -02:00
Fernando Jiménez Moreno
243b4e1a39 Do not set player EOS. Set input size only if it changes 2018-12-12 13:06:52 +01:00
Dan Robertson
62a9bfa0c5
script: Create structures for TextTrack API
Fill out the basics for the WebIDLs for the following:

  - TextTrack
  - TextTrackCue
  - TextTrackCueList
  - TextTrackList
2018-12-11 20:14:00 +00:00
Manish Goregaokar
5413328be2 Update webrender 2018-11-27 17:33:13 -08:00
Fernando Jiménez Moreno
f98da2e7b7 HTMLMediaElement playing attribute 2018-11-21 09:42:53 +01:00
ddh
26007fddd3 refactored performance timing to align with updated spec
refactoring with ResourceFetchMetadata

implemented deprecated window.timing functionality

created ResourceTimingListener trait

fixed w3c links in navigation timing

updated include.ini to run resource timing tests on ci
2018-11-20 16:21:32 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Agustin Chiappe Berrini
75eb94afca Unify the task source and task canceller API
I moved away from the `Window` struct all the logic to handle task
sources, into a new struct called `TaskManager`. In a happy world, I'd
be able to just have there two functions, of the types:

```rust
fn task_source<T: TaskSource>(&self, name: TaskSourceName) -> Box<T>
fn task_source_with_canceller<T: TaskSource>(&self, name: TaskSourceName)
  -> (Box<T>, TaskSourceCanceller)
```

And not so much duplicated code. However, because TaskSource can't be a
trait object (because it has generic type parameters), that's not
possible. Instead, I decided to reduce duplicated logic through macros.

For reasons[1], I have to pass both the name of the function with
canceller and the name of the function without, as I'm not able to
concatenate them in the macro itself. I could probably use
`concat_idents` to create both types already defined and reduce the
amount of arguments by one, but that macro is nightly only. At the same
time, not being able to declare macros inside `impl` forces me to pass
`self` as an argument.

All this makes this solution more verbose than it would be ideally. It
does reduce duplication, but it doesn't reduce the size of the file.

[1](https://github.com/rust-lang/rust/issues/29599)
2018-11-14 06:36:44 -05:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
bors-servo
b93d4b2ac6
Auto merge of #22129 - ferjm:media.task.source, r=Manishearth
HTMLMediaElement - use media element instead of dom manipulation task…

… source

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/22129)
<!-- Reviewable:end -->
2018-11-07 12:16:58 -05:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Fernando Jiménez Moreno
ebe6c3fac3 HTMLMediaElement - use media element instead of dom manipulation task source 2018-11-06 20:15:14 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Bastien Orivel
024b40b39d Update hyper to 0.12 2018-11-01 19:17:36 +01:00
Fernando Jiménez Moreno
35508c152a HTMLMediaElement - fire durationchange and resize iff something changes 2018-10-30 12:02:42 +01:00
Fernando Jiménez Moreno
7bf1944007 Rename seek_sync to seek_end 2018-10-26 10:22:00 +02:00
Fernando Jiménez Moreno
aa3c911efa HTMLMediaElement.seek: clean-up and update WPTs expectations 2018-10-26 10:22:00 +02:00
Fernando Jiménez Moreno
1f182d0bbd Remove seekable flag 2018-10-26 10:21:27 +02:00
Fernando Jiménez Moreno
44133bfb3c Byte range request for HTMLMediaElement seeking 2018-10-26 10:21:26 +02:00
Fernando Jiménez Moreno
75407822bc HTMLMediaElement seeking 2018-10-26 10:19:52 +02:00
Fernando Jiménez Moreno
2db141fb8b Setter and getter for HTMLMediaElement.currentTime 2018-10-26 10:17:32 +02:00
Fernando Jiménez Moreno
21f67a99f5 Update servo-media to fix intermittent timeouts 2018-10-24 16:36:50 +02:00
Alan Jeffrey
4282141c14 Updated servo-media 2018-10-22 19:39:36 -05:00
est31
af0f7db909 Implement basic <source> support for HtmlMediaElement
The spec has a complicated algorithm for selecting a <source>
element among multiple <source> children of a HtmlMediaElement
where it loops over all of them, tries each and takes the first
where "everything works out".

This commit implements a much simpler and restricted approach by
just taking the first <source> child, and if that fails,
failing altogether, without looking at any further children.

This is an improvement over the current status and makes gifv
items on imgur playable, although it doesn't mean full <source>
support.
2018-10-12 15:29:57 +02:00
chansuke
7b3cf27c69 Add task source for media element 2018-10-10 22:15:37 +09:00
Fernando Jiménez Moreno
11ac049d27 Make sure we do not skip the HaveMetadata state. Fixes a bunch of tests 2018-10-08 16:12:04 +02:00
Fernando Jiménez Moreno
6b0acc9cd8 Handle Player errors 2018-10-08 16:12:04 +02:00
Fernando Jiménez Moreno
0db628028a Update servo-media: handle decoder errors and use safer/nicer player API 2018-10-08 16:12:04 +02:00
Fernando Jiménez Moreno
e31339245c Move player setup to common path, deal with setup error and clean debug msgs 2018-10-08 16:12:04 +02:00
Víctor Manuel Jáquez Leal
59d8c95b23 Network EOF does't imply media processing EOS
Since media processing is highly asynchronous, there is no need to
match one event with the other. Then error handling is done when
the player emits the EOS event.

The have_metadata attribute is not required anymore.
2018-10-08 16:12:03 +02:00
Fernando Jiménez Moreno
1c92240310 Fix HAVE_METADATA and HAVE_CURRENT_DATA state transitions 2018-10-08 16:12:03 +02:00
Fernando Jiménez Moreno
dba61ad1df Do not set metadata until we have enough data 2018-10-08 16:12:03 +02:00