diff --git a/player/.gitkeep b/player/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/player/base.coffee b/player/base.coffee new file mode 100644 index 00000000..76b581be --- /dev/null +++ b/player/base.coffee @@ -0,0 +1,37 @@ +class Player + constructor: (data) -> + @load(data) + @paused = false + + load: (data) -> + @mediaId = data.id + @mediaType = data.type + + play: -> + @paused = false + + pause: -> + @paused = true + + seekTo: (time) -> + + setVolume: (volume) -> + + getTime: (cb) -> + cb(0) + + isPaused: (cb) -> + cb(@paused) + + getVolume: (cb) -> + cb(VOLUME) + +window.Player = Player + +window.removeOld = (replace) -> + $('#sc_volume').remove() + replace ?= $('
').addClass('embed-responsive-item') + old = $('#ytapiplayer') + replace.insertBefore(old) + old.remove() + replace.attr('id', 'ytapiplayer') diff --git a/player/videojs.coffee b/player/videojs.coffee new file mode 100644 index 00000000..0def6f76 --- /dev/null +++ b/player/videojs.coffee @@ -0,0 +1,6 @@ +class VideoJSPlayer extends Player + constructor: (data) -> + + load: (data) -> + video = $('