Streaming component for mediaplayer.
npm install @thoughtsunificator/mediaplayer-core
import { Core } from "domodel"
import { Player, PlayerBinding, PlayerModel } from "@thoughtsunificator/mediaplayer-core"
import { StreamingModel, StreamingBinding } from "@thoughtsunificator/mediaplayer-streaming"
window.addEventListener("load", async function() {
const player = new Player()
const hotkeys = {
38: "some event",
}
Core.run(PlayerModel, {
parentNode: document.body,
binding: new PlayerBinding({
player,
hotkeys,
model: StreamingModel,
binding: new StreamingBinding({ player })
})
})
player.emit("media url set", "./resource/trailer.mp4")
})
Name | Target |
---|---|
media url set | Player |
hud show | Player |
hud hide | Player |
video volumechange | Player |
video play | Player |
video pause | Player |
video playback toggle | Player |
video volume toggle | Player |
screenshot | Player |
video time set | Player |
video skip backward | Player |
video skip forward | Player |
video speed increase | Player |
video speed decrease | Player |
video volume toggle | Player |
video volume set | Player |
video mute set | Player |
video durationchange | Player |
video loadeddata | Player |
video progress | Player |
video loadeddata | Player |
video seeked | Player |
video timeupdate | Player |
video volumechange | Player |
See https://github.com/thoughtsunificator/mediaplayer-streaming-demo.