Fix url thingy

This commit is contained in:
Thomas Forgione 2021-06-09 18:59:20 +02:00
parent 4a79341245
commit 22fd24c13e
2 changed files with 11 additions and 10 deletions

View File

@ -31,14 +31,15 @@
} }
}); });
var app = Elm.Main.init({ const app = Elm.Main.init({
node: document.getElementById('container'), node: document.getElementById('container'),
flags: "video/manifest.m3u8",
}); });
app.ports.initVideo.subscribe(function() { app.ports.initVideo.subscribe(function(arg) {
const video = document.getElementById('video'); const video = document.getElementById('video');
const hls = new Hls(); const hls = new Hls();
hls.loadSource('video/manifest.m3u8'); hls.loadSource(arg);
hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
// Transform available levels into an array of integers (height values). // Transform available levels into an array of integers (height values).

View File

@ -14,10 +14,10 @@ import Icons
import Json.Decode as Decode import Json.Decode as Decode
main : Program Decode.Value Model Msg main : Program String Model Msg
main = main =
Browser.application Browser.application
{ init = \_ _ _ -> init { init = \url _ _ -> init url
, update = update , update = update
, view = view , view = view
, subscriptions = \_ -> nowHasQualities NowHasQualities , subscriptions = \_ -> nowHasQualities NowHasQualities
@ -55,10 +55,10 @@ type Msg
| NowHasQualities (List Int) | NowHasQualities (List Int)
init : ( Model, Cmd Msg ) init : String -> ( Model, Cmd Msg )
init = init url =
( Model ( Model
"video/manifest.m3u8" url
False False
0.0 0.0
1.0 1.0
@ -67,7 +67,7 @@ init =
False False
False False
[] []
, initVideo () , initVideo url
) )
@ -393,7 +393,7 @@ formatTime s =
hoursString ++ minutesString ++ ":" ++ secsString hoursString ++ minutesString ++ ":" ++ secsString
port initVideo : () -> Cmd msg port initVideo : String -> Cmd msg
port playPause : () -> Cmd msg port playPause : () -> Cmd msg