mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
fix(canvas): [PKG-CANVAS-SUBTITLE-01] attach native subtitle tracks
This commit is contained in:
1 parent
d89728c0a6
commit
c3967bcbf4
23 files changed
+1459
-11
No files matched your search
@@ -5,6 +5,7 @@ import { hasDimensions, resizeCanvas } from './geometry'
|
||||
import { ownMedia } from './media'
|
||||
import { createRenderer } from './renderer'
|
||||
import { createFrameScheduler } from './scheduler'
|
||||
import { forwardSubtitleTrack } from './subtitles'
|
||||
|
||||
function artplayerProxyCanvas(callback?: DrawCallback) {
|
||||
return (art: Artplayer): HTMLCanvasElement => {
|
||||
@@ -67,6 +68,7 @@ function artplayerProxyCanvas(callback?: DrawCallback) {
|
||||
}
|
||||
|
||||
try {
|
||||
forwardSubtitleTrack(canvas, video, constructor.utils.createElement('track'), active)
|
||||
listen('destroy', destroy)
|
||||
listen('video:loadedmetadata', () => {
|
||||
if (hasDimensions(video)) {
|
||||
|
||||
Reference in new issue
Block a user