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'),
|
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).
|
||||||
|
|
14
src/Main.elm
14
src/Main.elm
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue