This means keeping a reference to the MediaSource object in the MediaStream to
ensure it's being kept alive for the duration of the playback.
Differential Revision: https://phabricator.services.mozilla.com/D112607
When the audio sink shutdown, we should also reset the audible state for the listeners. Otherwise, MediaDecoderStateMachine would possibly rely on the incorrect audible state that is produced by previous sink, which would cause showing the sound indicator even if no sound is being playing.
Eg.
Considering following case without the reset of the audible state
1. Sink A is audible -> MDSM set `mIsAudioDataAudible=true`
2. Stop sink
3. Recreate sink B and it's playing silence -> MDSM's `mIsAudioDataAudible=true` is still true, this is wrong!
Differential Revision: https://phabricator.services.mozilla.com/D113550
Firefox and Chrome support setting `src` with an `ObjectURL`. This is
technically a URL and should be treated as such. Firefox recently changed to
return `""` when a `MediaSource` is playing, and this is wrong, because even
though it's playing a from a "Media Provider Object", it got loaded from the
`src` attribute, so should have a non-null `currentSrc`, which should be the
blob url (`blob:origin/<an uuid>`). In this case, `currentSrc` is a string that
is opaque and doesn't allow introspection but refers to the "real" `MediaSource`
or `Blob`.
If the same `MediaSource` is loaded via the `srcObject` attribute (that Firefox
and Chrome don't support), then `currentSrc` should return `""` and `srcObject`
still has the object set to it to understand what the HTMLMediaElement is
playing. We'll implement and test this later.
Differential Revision: https://phabricator.services.mozilla.com/D110290
Firefox and Chrome support setting `src` with an `ObjectURL`. This is
technically a URL and should be treated as such. Firefox recently changed to
return `""` when a `MediaSource` is playing, and this is wrong, because even
though it's playing a from a "Media Provider Object", it got loaded from the
`src` attribute, so should have a non-null `currentSrc`, which should be the
blob url (`blob:origin/<an uuid>`). In this case, `currentSrc` is a string that
is opaque and doesn't allow introspection but refers to the "real" `MediaSource`
or `Blob`.
If the same `MediaSource` is loaded via the `srcObject` attribute (that Firefox
and Chrome don't support), then `currentSrc` should return `""` and `srcObject`
still has the object set to it to understand what the HTMLMediaElement is
playing. We'll implement and test this later.
Differential Revision: https://phabricator.services.mozilla.com/D110290
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.
Differential Revision: https://phabricator.services.mozilla.com/D105473
Add test cases for `DecoderDoctorDiagnostics::StoreFormatDiagnostics()`, which is used when checking the ability of whether the decoder is supported for certain type.
Differential Revision: https://phabricator.services.mozilla.com/D104475
Add test cases for `DecoderDoctorDiagnostics::StoreFormatDiagnostics()`, which is used when checking the ability of whether the decoder is supported for certain type.
Differential Revision: https://phabricator.services.mozilla.com/D104475
Roughly:
- Don't reset on load
- Don't reset on URL parsing error
- Reset when playing a MediaStream, a MediaSource
- Otherwise follow the resource selection algorithm, and set it to what has been selected
Differential Revision: https://phabricator.services.mozilla.com/D101937
`nsSyncSection` is not related with media event, so that's not proper ot put it in `MediaElementEventRunners.h`.
In addition, that can simply be implemented by `NS_NewRunnableFunction` so we don't need `nsSyncSection` anymore.
Differential Revision: https://phabricator.services.mozilla.com/D104115
Inplemented an event runner for `timeupdate` only, which would ensure that for periodic `timeupdate` it should be only dispatched once within 250ms.
Differential Revision: https://phabricator.services.mozilla.com/D102675
In this patch, we move all event runners to a separate file and implement an event blocker.
In order to allow us to do a special check for `timeupdate` event, we have to know that event is periodic or mandatory.
We have to save extra information for `timeupdate, however, current design for storing pending events is not flexible enough to achieve that.
Therefore, instead of storing the event name, we store the event runners which can all have different implementation and know when they should dispatch their own event.
Differential Revision: https://phabricator.services.mozilla.com/D102673
`nsSyncSection` is not related with media event, so that's not proper ot put it in `MediaElementEventRunners.h`.
In addition, that can simply be implemented by `NS_NewRunnableFunction` so we don't need `nsSyncSection` anymore.
Differential Revision: https://phabricator.services.mozilla.com/D104115
Inplemented an event runner for `timeupdate` only, which would ensure that for periodic `timeupdate` it should be only dispatched once within 250ms.
Differential Revision: https://phabricator.services.mozilla.com/D102675
In this patch, we move all event runners to a separate file and implement an event blocker.
In order to allow us to do a special check for `timeupdate` event, we have to know that event is periodic or mandatory.
We have to save extra information for `timeupdate, however, current design for storing pending events is not flexible enough to achieve that.
Therefore, instead of storing the event name, we store the event runners which can all have different implementation and know when they should dispatch their own event.
Differential Revision: https://phabricator.services.mozilla.com/D102673