D15724: Wait for duration to be known before registering player
Kai Uwe Broulik
noreply at phabricator.kde.org
Mon Sep 24 12:11:19 BST 2018
broulik created this revision.
broulik added reviewers: Plasma, davidedmundson, fvogt.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.
REVISION SUMMARY
A player might emit a `play` signal before its `duration` is known.
We want to avoid controlling short sounds (e.g. chat notifications) but I found the `duration` often is `NaN` on first invication when the sound is loaded for the first time.
Defer activating the player until we get a `durationchange` event for that player
TEST PLAN
- No longer have it trying to control Facebook Messenger notification sounds
- YouTube still works fine
- Some random music stream (`duration` of `Infinity`) still works
- HTML Media sessions example (both video and audo) still work fine
REPOSITORY
R856 Plasma Browser Integration
REVISION DETAIL
https://phabricator.kde.org/D15724
AFFECTED FILES
extension/content-script.js
To: broulik, #plasma, davidedmundson, fvogt
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180924/420b955c/attachment.html>
More information about the Plasma-devel
mailing list