Added another streaming test

This commit is contained in:
Eduard Urbach 2018-12-09 12:37:54 +09:00
parent 6489b550c9
commit 9b2a973af0
3 changed files with 27 additions and 1 deletions

View File

@ -5,7 +5,7 @@ component AnimeEpisode(anime *arn.Anime, episode *arn.AnimeEpisode, episodeIndex
if anime.ID == "GWyShKmiR" && episode.Number == 10
.widget-form.amv-page
.video-container(id="stream-test")
video.video.lazy.action(data-action="togglePlayVideo", data-trigger="click", data-media-id="stream-test")
video.video.lazy.action(data-action="toggleFullscreen", data-trigger="dblclick", data-id="stream-test")
source(data-src="https://arn.sfo2.cdn.digitaloceanspaces.com/videos/anime/GWyShKmiR/10.webm", data-type="video/webm")
track(label="English", kind="subtitles", srclang="en", src="https://arn.sfo2.cdn.digitaloceanspaces.com/videos/anime/GWyShKmiR/10.en.vtt", default)

View File

@ -5,6 +5,7 @@ import PushManager from "./PushManager"
import TouchController from "./TouchController"
import NotificationManager from "./NotificationManager"
import AudioPlayer from "./AudioPlayer"
import VideoPlayer from "./VideoPlayer"
import Analytics from "./Analytics"
import SideBar from "./SideBar"
import InfiniteScroller from "./InfiniteScroller"
@ -28,6 +29,7 @@ export default class AnimeNotifier {
notificationManager: NotificationManager
touchController: TouchController
audioPlayer: AudioPlayer
videoPlayer: VideoPlayer
sideBar: SideBar
infiniteScroller: InfiniteScroller
mainPageLoaded: boolean
@ -1345,6 +1347,13 @@ export default class AnimeNotifier {
return preventDefault()
}
// Space = Toggle play
if(e.keyCode === 32) {
// this.audioPlayer.playPause()
this.videoPlayer.playPause()
return preventDefault()
}
// Number keys activate sidebar menus
for(let i = 48; i <= 57; i++) {
if(e.keyCode === i) {

17
scripts/VideoPlayer.ts Normal file
View File

@ -0,0 +1,17 @@
import AnimeNotifier from "./AnimeNotifier"
export default class VideoPlayer {
arn: AnimeNotifier
constructor(arn: AnimeNotifier) {
this.arn = arn
}
play(video: HTMLVideoElement) {
}
playPause() {
}
}