From f267adf53fbfa8f53bb3e85c5af5e8b925ae8cdc Mon Sep 17 00:00:00 2001 From: RblSb Date: Sun, 16 Feb 2025 15:08:15 +0300 Subject: PeerTube support closes #46 --- src/client/Main.hx | 4 +- src/client/Player.hx | 6 +- src/client/players/Peertube.hx | 136 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 src/client/players/Peertube.hx (limited to 'src') diff --git a/src/client/Main.hx b/src/client/Main.hx index 660693b..42030dd 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -330,7 +330,9 @@ class Main { final colonPort = port.length > 0 ? ':$port' : port; url = '$protocol//$host$colonPort$url'; } - if (!url.startsWith("http")) url = '$protocol//$url'; + if (!url.startsWith("pt:")) { + if (!url.startsWith("http")) url = '$protocol//$url'; + } final obj:VideoDataRequest = { url: url, diff --git a/src/client/Player.hx b/src/client/Player.hx index 6be8a07..9b22748 100644 --- a/src/client/Player.hx +++ b/src/client/Player.hx @@ -6,6 +6,7 @@ import Types.VideoDataRequest; import Types.VideoItem; import client.Main.getEl; import client.players.Iframe; +import client.players.Peertube; import client.players.Raw; import client.players.Streamable; import client.players.Vk; @@ -30,7 +31,6 @@ class Player { var isLoaded = false; var skipSetTime = false; var skipSetRate = false; - var streamable:Streamable; final voiceOverInput:InputElement = getEl("#voiceoverurl"); var audioTrack:Null