I’m trying to make a small extension to allow me to play/pause a video playing in a browser tab using controls placed on status bar.
Can I do that using youtube api?
What’s the easiest way to do it?
I’m trying to write it using Add-on SDK. Is that a bad idea?
I don’t know much about the youtube api, but it looks like you could do this for cases where the youtube player is embedded into a page ( as opposed to the video being displayed on the youtube website itself ):
In your Jetpack add-on, you would use page-mod to inject a script into the page that then calls methods like ‘player.play()’, etc. These methods would be triggered by sending messages from your widget, through the main.js script, to the worker for the page-mod.
For more info on how content script communications work, please see the SDK docs:
https://addons.mozilla.org/en-US/developers/docs/sdk/1.6/dev-guide/guides/content-scripts/index.html