browser-player icon indicating copy to clipboard operation
browser-player copied to clipboard

Doesn't work with elements not in the DOM and Web API

Open fregante opened this issue 9 years ago • 1 comments

This currently only works with audio/video elements in the DOM.

Ideas:

  • hijack interfaces like Audio().play() so we can skip DOM events altogether
  • find magic API that tells me if anything's playing

fregante avatar Jun 25 '15 04:06 fregante

Something like this:

HTMLMediaElement.prototype._play = HTMLMediaElement.prototype.play
HTMLMediaElement.prototype.play = function () {
    console.log('playing');
    this._play();
} // youtube

Audio.prototype._play = Audio.prototype.play
Audio.prototype.play = function () {
    console.log('playing');
    this._play();
} // 8tracks

…would add support for:

  • SoundCloud
  • 8tracks
  • Rdio

fregante avatar Jun 25 '15 04:06 fregante