Page MenuHomePhabricator

Add a "Play Sound" workboard trigger rule
ClosedPublic

Authored by epriestley on Mar 21 2019, 10:26 PM.
Tags
None
Referenced Files
F13050662: D20306.id48504.diff
Fri, Apr 19, 3:05 AM
F13050661: D20306.id48488.diff
Fri, Apr 19, 3:05 AM
F13050660: D20306.id48460.diff
Fri, Apr 19, 3:05 AM
F13050659: D20306.id.diff
Fri, Apr 19, 3:05 AM
Unknown Object (File)
Thu, Apr 18, 8:52 AM
Unknown Object (File)
Thu, Apr 18, 8:52 AM
Unknown Object (File)
Thu, Apr 18, 8:52 AM
Unknown Object (File)
Thu, Apr 18, 8:49 AM
Subscribers
None

Details

Summary

Ref T5474. Allow columns to play a sound when tasks are dropped.

This is a little tricky because Safari has changed somewhat recently to require some gymnastics to play sounds when the user didn't explicitly click something. Preloading the sound on the first mouse interaction, then playing and immediately pausing it seems to work, though.

Test Plan

Added a trigger with 5 sounds. In Safari, Chrome, and Firefox, dropped a card into the column. In all browsers, heard a nice sequence of 5 sounds played one after the other.

Diff Detail

Repository
rP Phabricator
Branch
trigger12
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22360
Build 30593: Run Core Tests
Build 30592: arc lint + arc unit

Event Timeline

amckinley added inline comments.
webroot/rsrc/js/application/projects/behavior-project-boards.js
172

This callback only gets triggered on the first mousedown, right?

This revision is now accepted and ready to land.Mar 25 2019, 6:31 PM
webroot/rsrc/js/application/projects/behavior-project-boards.js
172

It runs on each click, but sounds is empty after the first time so it's effectively a no-op.

(There's currently no super convenient way to do a listenOnce() kind of thing. The callback could unregister the listener, but the cost of keeping this callback around should be insignificant.)

  • Instead of doing sounds = [], just do listener.remove() to remove the listener.
This revision was automatically updated to reflect the committed changes.