Closed Bug 1473985 Opened 6 years ago Closed 5 years ago

Promises are not considered part of user-interaction, breaking Twitch embedded replay button.

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1469200
Webcompat Priority P3
Tracking Status
firefox63 --- affected

People

(Reporter: twisniewski, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [webcompat:p3])

In bug 1469200, I found that Twitch's embedded player is calling a video's play() function not directly as part of the `click` event, but in a promise that is made while handling the click event:

>key: 'play',
>value: function () {
>  var e = this;
>  return this._srcReady.then(function () {
>    return new Promise(function (t) {
>      if (e._video.readyState >= 3)
>        t(e._video.play());
>      else {
>        var n = function n() {
>          e._video.removeEventListener(o.c, n),
>          t(e._video.play())
>        };
>        e._video.addEventListener(o.c, n)
>      }
>    })
>  }).catch (function (t) {
>    'NotAllowedError' === t.name && (e._video.dispatchEvent(new CustomEvent(o.m)), e._video.dispatchEvent(new CustomEvent(o.k)))
>  })
>}

Chrome allows the play promise to resolve, Firefox does not (it never resolves or rejects it).

If I do not wait for the _srcReady or other promises, then it plays fine in Firefox (but is missing Twitch's error-handling):

>key: 'play',
>value: function () {
>  var e = this;
>  return e._video.play();
>}

This makes me suspect that we should carry over permission to call play through into promise callbacks (and possibly requestAnimationFrame as well).
Flags: webcompat?
(Promises have nothing to do with event handling)
Component: DOM: Events → DOM
Priority: -- → P3
Flags: webcompat? → webcompat+
Whiteboard: [webcompat] → [webcompat:p3]
Priority: P3 → P2
Component: DOM → DOM: Core & HTML

See bug 1547409. Migrating webcompat priority whiteboard tags to project flags.

Webcompat Priority: --- → P3

Tom, can we re-test to see if these reproduces?

Flags: needinfo?(twisniewski)

(In reply to Mike Taylor [:miketaylr] from comment #3)

Tom, can we re-test to see if these reproduces?

Just tested it - still reproducible.

Flags: needinfo?(twisniewski)

Confirmed, the test case in https://bugzilla.mozilla.org/show_bug.cgi?id=1469200#c3 still reproduces.

(In reply to Thomas Wisniewski [:twisniewski] from comment #5)

Confirmed, the test case in https://bugzilla.mozilla.org/show_bug.cgi?id=1469200#c3 still reproduces.

https://bugzilla.mozilla.org/show_bug.cgi?id=1469200#c12 pointed out that this looks the website issue.

Should we just close this as duplicate of bug 1469200?

Flags: needinfo?(twisniewski)

Yes, based on that we might we well just close this as a dupe, thanks.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(twisniewski)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.