feat(media): expose media stream and video interface shells

This commit is contained in:
ldm0
2026-10-11 18:06:46 +08:00
parent 2710e3201f
commit 25dbbc7dfb
3 changed files with 115 additions and 1 deletions
@@ -37,6 +37,12 @@ pub(in crate::context_bootstrap) const WORKER_SHARED_INTERFACE_NAMES: &[&str] =
"MIDIPort",
"VideoDecoder",
"VideoEncoder",
"ImageBitmapRenderingContext",
"MediaSourceHandle",
"SourceBuffer",
"SourceBufferList",
"VideoColorSpace",
"VideoFrame",
"EventTarget",
"Event",
"CustomEvent",
@@ -253,7 +259,15 @@ const WINDOW_DEDICATED_AND_SHARED_WORKER_INTERFACE_NAMES: &[&str] = &[
"XMLHttpRequest",
];
const DEDICATED_AND_SHARED_WORKER_INTERFACE_NAMES: &[&str] = &["FileReaderSync"];
const WINDOW_AND_DEDICATED_WORKER_INTERFACE_NAMES: &[&str] = &["VideoDecoder", "VideoEncoder"];
const WINDOW_AND_DEDICATED_WORKER_INTERFACE_NAMES: &[&str] = &[
"VideoDecoder",
"VideoEncoder",
"MediaSourceHandle",
"SourceBuffer",
"SourceBufferList",
"VideoColorSpace",
"VideoFrame",
];
pub(in crate::context_bootstrap) const INDEXED_DB_INTERFACE_NAMES: &[&str] = &[
"DOMStringList",
@@ -136,6 +136,86 @@ const CONSTRUCTOR_SPECS_BEFORE_STREAMS: &[ConstructorSpec] = &[
interface: web_api_interfaces::CSSTransition::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::CanvasCaptureMediaStreamTrack::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::ImageBitmapRenderingContext::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::MediaEncryptedEvent::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 1 },
},
ConstructorSpec {
interface: web_api_interfaces::MediaMetadata::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 0 },
},
ConstructorSpec {
interface: web_api_interfaces::MediaRecorder::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 1 },
},
ConstructorSpec {
interface: web_api_interfaces::MediaSession::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::MediaSourceHandle::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::MediaStream::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 0 },
},
ConstructorSpec {
interface: web_api_interfaces::MediaStreamTrack::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::MediaStreamTrackEvent::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 2 },
},
ConstructorSpec {
interface: web_api_interfaces::OverconstrainedError::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 1 },
},
ConstructorSpec {
interface: web_api_interfaces::PictureInPictureEvent::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 2 },
},
ConstructorSpec {
interface: web_api_interfaces::PictureInPictureWindow::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::RemotePlayback::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::SourceBuffer::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::SourceBufferList::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::TimeRanges::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::VideoColorSpace::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 0 },
},
ConstructorSpec {
interface: web_api_interfaces::VideoFrame::DESCRIPTOR,
kind: ConstructorKind::Shell { length: 1 },
},
ConstructorSpec {
interface: web_api_interfaces::VideoPlaybackQuality::DESCRIPTOR,
kind: ConstructorKind::Illegal,
},
ConstructorSpec {
interface: web_api_interfaces::External::DESCRIPTOR,
kind: ConstructorKind::Illegal,
@@ -49,6 +49,26 @@ interfaces! {
VideoEncoder: EventTarget;
CSSAnimation: Animation;
CSSTransition: Animation;
CanvasCaptureMediaStreamTrack: MediaStreamTrack;
ImageBitmapRenderingContext;
MediaEncryptedEvent: Event;
MediaMetadata;
MediaRecorder: EventTarget;
MediaSession;
MediaSourceHandle;
MediaStream: EventTarget;
MediaStreamTrack: EventTarget;
MediaStreamTrackEvent: Event;
OverconstrainedError: DOMException;
PictureInPictureEvent: Event;
PictureInPictureWindow: EventTarget;
RemotePlayback: EventTarget;
SourceBuffer: EventTarget;
SourceBufferList: EventTarget;
TimeRanges;
VideoColorSpace;
VideoFrame;
VideoPlaybackQuality;
AbortController;
AbortSignal: EventTarget;
AbstractRange;