MediaStreamTrackGenerator: thuộc tính writable
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Thuộc tính writable của giao diện MediaStreamTrackGenerator trả về một WritableStream. Điều này cho phép ghi các khung phương tiện vào MediaStreamTrackGenerator. Các khung có thể là âm thanh hoặc video. Loại được xác định bởi loại MediaStreamTrackGenerator được tạo.
Giá trị
Một WritableStream.
Ví dụ
Trong ví dụ sau, các khung video được biến đổi rồi ghi vào WritableStream được truy cập bằng MediaStreamTrackGenerator.writable.
const trackProcessor = new MediaStreamTrackProcessor({ track: videoTrack });
const trackGenerator = new MediaStreamTrackGenerator({ kind: "video" });
/* */
trackProcessor.readable
.pipeThrough(transformer)
.pipeTo(trackGenerator.writable);