我试图通过缺乏不同的描述来实现离线媒体上下文.
这个概念是创造1秒Blob的录制媒体,具有的能力
Blobs独立播放1秒HTMLMediaElementBlobs 播放完整的媒体资源问题是,一旦Blobs被连接起来,媒体资源就不会HTMLMedia使用a Blob URL或者在元素上播放MediaSource.
创建的Blob URL只播放连接Blob的1秒.MediaSource抛出两个例外
DOMException: Failed to execute 'addSourceBuffer' on 'MediaSource': The MediaSource's readyState is not 'open'
Run Code Online (Sandbox Code Playgroud)
和
DOMException: Failed to execute 'appendBuffer' on 'SourceBuffer': This SourceBuffer has been removed from the parent media source.
Run Code Online (Sandbox Code Playgroud)
如何正确编码连接的Blobs或以其他方式实现变通方法以将媒体片段作为单个重组媒体资源播放?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
const src = "https://nickdesaulniers.github.io/netfix/demo/frag_bunny.mp4";
fetch(src)
.then(response => response.blob())
.then(blob => …Run Code Online (Sandbox Code Playgroud) 作为一名长期参与JavaScript编程的程序员,尽管阅读了很多文章,但我仍然有以下问题尚不清楚.
对于以下代码,
class Animal {
constructor(public name) { }
move(meters) {
console.log(this.name + " moved " + meters + "m.");
}
}
class Snake extends Animal {
move() {
console.log("Slithering...");
super.move(5);
}
}
class Horse extends Animal {
move() {
console.log("Galloping...");
super.move(45);
}
var sam = new Snake("Sammy the Python")
var tom: Animal = new …Run Code Online (Sandbox Code Playgroud)