(In reply to Andreas Pehrson [:pehrsons] from comment #46) > - Setting `srcObject` to null runs `DoLoad()` at [1], which does `AbortExistingLoads()` at [2], which fires "pause" at [3] (sync with setting the srcObject). The spec says this about the pausing in the load algorithm: > 6. If the paused attribute is false, then: > 1. Set the paused attribute to true. > 2. Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException. However, our code in addition to those two steps also fires "paused", [4]. This looks like a bug in our implementation. This was added in [5] as part of bug 1461877. Chris, seeing that you added that, can you take a look? I don't see from that commit message why there was a need to dispatch "pause". [4] https://searchfox.org/mozilla-central/rev/0376cbf447efa16922c550da3bfd783b916e35d3/dom/html/HTMLMediaElement.cpp#1850 [5] https://hg.mozilla.org/mozreview/gecko/rev/d51aee3f128bb3984e3f50e466a03f74215bfe2c#index_header
Bug 1525209 Comment 47 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Andreas Pehrson [:pehrsons] from comment #46) > - Setting `srcObject` to null runs `DoLoad()` at [1], which does `AbortExistingLoads()` at [2], which fires "pause" at [3] (sync with setting the srcObject). The spec says this about the pausing in the load algorithm: > 6. If the paused attribute is false, then: > 1. Set the paused attribute to true. > 2. Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException. However, our code in addition to those two steps also fires "paused", [4]. This looks like a bug in our implementation. This was added in [5] as part of bug 1461877. Chris, seeing that you added that, can you take a look? I don't see from that commit message why there was a need to dispatch "pause". [4] https://searchfox.org/mozilla-central/rev/0376cbf447efa16922c550da3bfd783b916e35d3/dom/html/HTMLMediaElement.cpp#1850 [5] https://hg.mozilla.org/mozreview/gecko/rev/d51aee3f128bb3984e3f50e466a03f74215bfe2c#index_header