-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
broadcast event before playing and after completing #13
Comments
@bamnet can give give me a rough idea on the best way to implement this? |
Certainly! content.js has some good examples how to throw events. We define them at the bottom, and then you just Listening might be the trickier part, as you'd typically setup to listen to the event on a specific object (like the video) instead of any object in the field. We probably need to clean up the frontend API to propagate some events at the field / position level to make this easier. Maybe you could reach from the content up to the field and dispatch the event on the field. |
Wouldn't the video content need to notify the screen and then the screen On Jan 6, 2014, at 6:57 PM, Brian Michalski [email protected] Certainly! content.js has some good examples how to throw events. We define them at Listening might be the trickier part, as you'd typically setup to listen to Maybe you could reach from the content up to the field and dispatch the — |
That's one way we could implement it, the screen could provide a pubsub mechanism. Playing sound is kind of a universal state which makes sense to propagate all the way up to the screen level, but I think it's one of the few exceptions. If you look at something like the Google Maps API, you can setup an event listener to get fired when a marker is being dragged across the map. You do that by calling addEventListener(marker, 'dragged', function()) and some magic calls the function every time that specific marker is dragged. You could also do addEventListener(map, 'mousemove', function()) and deduce which marker is moving because those events are fired as well, but you'd have to deduce which marker is moving. The same thing applies here, it's not super useful for the screen to say "video is playing", maybe useful to say "audio is playing"... but it's certainly useful to hear that from the content and probably the field. (you could use that event listener to make a special video play icon pop up on the field, or a speaker if there's sound to help identify the source). From the video side of things, I think it makes sense for video to broadcast from itself that it's playing. As a workaround you can broadcast on the field as well to make listening easier, but longer term we should make sure that certain events bubble up all the way to the screen, some get to the field, and some stay at the content level. |
See concerto/concerto#802
The text was updated successfully, but these errors were encountered: