CyTube/player/odysee.coffee

22 lines
598 B
CoffeeScript
Raw Normal View History

2022-01-28 15:18:10 +00:00
window.OdyseePlayer = class OdyseePlayer extends PlayerJSPlayer
2022-01-28 13:34:22 +00:00
constructor: (data) ->
if not (this instanceof OdyseePlayer)
return new OdyseePlayer(data)
2022-01-28 15:18:10 +00:00
super(data)
2022-01-28 13:34:22 +00:00
load: (data) ->
@ready = false
2022-01-28 15:18:10 +00:00
@setMediaProperties(data)
2022-01-28 13:34:22 +00:00
waitUntilDefined(window, 'playerjs', =>
iframe = $('<iframe/>')
.attr(
src: data.meta.embed.src
allow: 'autoplay; fullscreen'
)
removeOld(iframe)
2022-01-28 15:18:10 +00:00
@setupPlayer(iframe[0], data)
2022-01-28 13:34:22 +00:00
)