refactor(mediabunny): [PKG-MB-08] finish typed media capability boundaries

This commit is contained in:
Harvey Zhao committed 2026-09-12 21:51:47 +08:00
1 parent 5e28dfee95
commit fb9fb23f53
25 files changed
+2698 -30

No files matched your search

+4
View File
@@ -363,6 +363,8 @@ async function loadingEnvironment() {
const audio = deferred()
const metadata = {}
env.engine.video.load = (media, callback) => {
// This fixture represents a supported decoder whose metadata/completion are delayed.
env.engine.video.videoSink = {}
metadata.video = callback
return video.promise
}
@@ -493,6 +495,8 @@ function replacementEnvironment() {
const track = { isLive: async () => false }
const input = { getDurationFromMetadata: async () => 8 }
env.engine.media = { input, videoTrack: track, audioTrack: null, isHls: true, videoMode: 'auto', audioMode: 'auto', duration: 8 }
// The already selected media has a working video decoder before a replacement starts.
env.engine.video.videoSink = {}
env.engine.video.load = async () => env.calls.push('video:load')
env.engine.audio.load = async () => env.calls.push('audio:load')
return env