build all

This commit is contained in:
Harvey Zhao committed 2025-12-13 14:11:16 +08:00
1 parent b84b0af2ec
commit 48b3f76151
228 files changed
+327 -310

No files matched your search

@@ -50,7 +50,7 @@ export default function createAudioEngine(events) {
return
const AudioContext
= window.AudioContext || window.webkitAudioContext
= window.AudioContext || window.webkitAudioContext
try {
audioContext = new AudioContext({ sampleRate })
@@ -195,8 +195,8 @@ export default function createAudioEngine(events) {
node.playbackRate.value = _playbackRate
const startAt
= audioContextStartTime
+ (timestamp - playbackTimeAtStart) / _playbackRate
= audioContextStartTime
+ (timestamp - playbackTimeAtStart) / _playbackRate
const duration = buffer.duration
const endAt = startAt + duration / _playbackRate
@@ -16,16 +16,16 @@ export default function createMediabunnyEngine({
}
const audio = createAudioEngine(events)
const video = createVideoEngine({
canvas,
ctx,
events,
timeupdateInterval: option.timeupdateInterval ?? defaults.timeupdateInterval,
avSyncTolerance: option.avSyncTolerance ?? defaults.avSyncTolerance,
dropLateFrames: option.dropLateFrames ?? defaults.dropLateFrames,
poster: option.poster ?? defaults.poster,
preflightRange: option.preflightRange ?? false,
})
const video = createVideoEngine({
canvas,
ctx,
events,
timeupdateInterval: option.timeupdateInterval ?? defaults.timeupdateInterval,
avSyncTolerance: option.avSyncTolerance ?? defaults.avSyncTolerance,
dropLateFrames: option.dropLateFrames ?? defaults.dropLateFrames,
poster: option.poster ?? defaults.poster,
preflightRange: option.preflightRange ?? false,
})
let _paused = true
let _ended = false
@@ -56,11 +56,11 @@ export default function createMediabunnyEngine({
let timer = null
const timeoutPromise
= loadTimeout > 0
? new Promise((_, reject) => {
timer = setTimeout(() => reject(new Error('Load timeout')), loadTimeout)
})
: null
= loadTimeout > 0
? new Promise((_, reject) => {
timer = setTimeout(() => reject(new Error('Load timeout')), loadTimeout)
})
: null
const loadTask = (async () => {
try {
@@ -2,4 +2,4 @@ export default function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms)
})
}
}