我正在尝试通过socket.io将视频文件流式传输到客户端(当前使用Chrome作为客户端)。我只得到视频的第一帧,然后出现Failed to appendBuffer:
无法对'SourceBuffer'执行'appendBuffer':HTMLMediaElement.error属性不为null
JS代码的一部分:
if (buffer.updating || queue.length > 0) {
console.log("buffer.updating = " + buffer.updating + " queue.length = " + (queue.length));
queue.push(videoData);
} else {
console.log("else buffer.updating = " + buffer.updating + " queue.length = " + (queue.length));
buffer.appendBuffer(videoData);
}
}
};
var play = function() {
//var mimeType = `video/mp4;codecs="${$scope.codec}"`;
var mimeType = 'video/mp4;codecs="' + codec +'"';
console.log("mimetype = " + mimeType + " is supported = " + MediaSource.isTypeSupported(mimeType));
buffer = mediaSource.addSourceBuffer(mimeType);
buffer.addEventListener('update', function () …Run Code Online (Sandbox Code Playgroud) 我想通过 Glide 通过将图像从 URL 加载到图像视图来播放视频。,我尝试通过使用以下代码调用相同的 URL 来刷新图像:
Glide.with(context)
.load(imageUrl)
.apply(RequestOptions.skipMemoryCacheOf(true))
.apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.NONE))
.into(imageView);
Run Code Online (Sandbox Code Playgroud)
如何在循环中做到这一点???我总是遇到例外