Skip to content

Commit

Permalink
Danmaku (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya authored Sep 15, 2024
1 parent 89f983e commit 43f3bb4
Show file tree
Hide file tree
Showing 17 changed files with 825 additions and 3,014 deletions.
23 changes: 12 additions & 11 deletions examples/standalone/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { html, render } from 'lit'
import { live } from 'lit/directives/live.js'

import { Player, PlayerEvent } from '@oplayer/core'
import danmaku from '@oplayer/danmaku'
import { Player } from '@oplayer/core'
import Danmaku from '@oplayer/danmaku'
import dash from '@oplayer/dash'
import hls from '@oplayer/hls'
import mpegts from '@oplayer/mpegts'
Expand All @@ -20,7 +19,7 @@ interface Ctx {
hls: ReturnType<typeof hls>
dash: ReturnType<typeof dash>
mpegts: ReturnType<typeof mpegts>
danmaku: ReturnType<typeof danmaku>
danmaku: Danmaku
playlist: Playlist
}

Expand All @@ -47,7 +46,7 @@ const player = Player.make<Ctx>('#player', {
poster: POSTER,
title: '君の名は'
},
videoAttr: { crossorigin: 'anonymous' }, // screenshot
// videoAttr: { crossorigin: 'anonymous' }, // screenshot
lang: 'en'
// isNativeUI: () => true
})
Expand Down Expand Up @@ -132,17 +131,19 @@ const player = Player.make<Ctx>('#player', {
</svg>`
}
}),
torrent(),
torrent({
library: 'https://cdn.jsdelivr.net/npm/[email protected]/webtorrent.min.js'
}),
hls({ forceHLS: true }),
dash(),
mpegts(),
danmaku({
enable: false,
new Danmaku({
enable: true
// displaySender: true,
source: DANMAKU //SUPER_DANMAKU
// source: DANMAKU //SUPER_DANMAKU
}),
new Playlist({
initialIndex: 0,
initialIndex: 6,
sources: [
{
title: 'hls - muti quality & subtitle & audio',
Expand Down Expand Up @@ -170,7 +171,7 @@ const player = Player.make<Ctx>('#player', {
poster: POSTER,
src: MP4,
duration: '01:32',
danmaku: SUPER_DANMAKU,
danmaku: DANMAKU,
thumbnails: {
src: THUMB,
number: 100
Expand Down
Loading

0 comments on commit 43f3bb4

Please sign in to comment.