Fix url thingy
This commit is contained in:
parent
4a79341245
commit
22fd24c13e
|
@ -31,14 +31,15 @@
|
|||
}
|
||||
});
|
||||
|
||||
var app = Elm.Main.init({
|
||||
const app = Elm.Main.init({
|
||||
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 hls = new Hls();
|
||||
hls.loadSource('video/manifest.m3u8');
|
||||
hls.loadSource(arg);
|
||||
|
||||
hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
|
||||
// Transform available levels into an array of integers (height values).
|
||||
|
|
14
src/Main.elm
14
src/Main.elm
|
@ -14,10 +14,10 @@ import Icons
|
|||
import Json.Decode as Decode
|
||||
|
||||
|
||||
main : Program Decode.Value Model Msg
|
||||
main : Program String Model Msg
|
||||
main =
|
||||
Browser.application
|
||||
{ init = \_ _ _ -> init
|
||||
{ init = \url _ _ -> init url
|
||||
, update = update
|
||||
, view = view
|
||||
, subscriptions = \_ -> nowHasQualities NowHasQualities
|
||||
|
@ -55,10 +55,10 @@ type Msg
|
|||
| NowHasQualities (List Int)
|
||||
|
||||
|
||||
init : ( Model, Cmd Msg )
|
||||
init =
|
||||
init : String -> ( Model, Cmd Msg )
|
||||
init url =
|
||||
( Model
|
||||
"video/manifest.m3u8"
|
||||
url
|
||||
False
|
||||
0.0
|
||||
1.0
|
||||
|
@ -67,7 +67,7 @@ init =
|
|||
False
|
||||
False
|
||||
[]
|
||||
, initVideo ()
|
||||
, initVideo url
|
||||
)
|
||||
|
||||
|
||||
|
@ -393,7 +393,7 @@ formatTime s =
|
|||
hoursString ++ minutesString ++ ":" ++ secsString
|
||||
|
||||
|
||||
port initVideo : () -> Cmd msg
|
||||
port initVideo : String -> Cmd msg
|
||||
|
||||
|
||||
port playPause : () -> Cmd msg
|
||||
|
|
Loading…
Reference in New Issue