From 6b39d754d3da0f1f516ebbb70fa313446d2bb9f2 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Fri, 28 Jan 2022 05:34:22 -0800 Subject: [PATCH] Add Odysee support --- bin/build-player.js | 1 + player/odysee.coffee | 80 ++++++++++++++++++++++++++++++++++++++++++++ player/update.coffee | 1 + src/get-info.js | 11 ++++++ src/utilities.js | 3 ++ www/js/util.js | 9 +++++ 6 files changed, 105 insertions(+) create mode 100644 player/odysee.coffee diff --git a/bin/build-player.js b/bin/build-player.js index bf438866..cf2fc78d 100755 --- a/bin/build-player.js +++ b/bin/build-player.js @@ -24,6 +24,7 @@ var order = [ 'twitchclip.coffee', 'peertube.coffee', 'iframechild.coffee', + 'odysee.coffee', 'update.coffee' ]; diff --git a/player/odysee.coffee b/player/odysee.coffee new file mode 100644 index 00000000..3babd3b8 --- /dev/null +++ b/player/odysee.coffee @@ -0,0 +1,80 @@ +window.OdyseePlayer = class OdyseePlayer extends Player + constructor: (data) -> + if not (this instanceof OdyseePlayer) + return new OdyseePlayer(data) + + @load(data) + + load: (data) -> + @setMediaProperties(data) + @ready = false + + waitUntilDefined(window, 'playerjs', => + iframe = $('