Stack Overflow на русском Asked by Alex_Verizhnikov on December 30, 2021
minioClient.getObject("busket", "name.mp4", function(
err,
stream
) {
if (err) {
return console.log(err);
}
console.log("stream", stream);
stream.on("data", function(chunk) {
size += chunk.length;
});
stream.on("end", function() {
console.log("End. Total size = " + size);
});
stream.on("error", function(err) {
console.log(err);
});
});
let player = document.getElementById("introduction");
Как использовать полученный stream
в player
?
Спасибо огромное за ответ. Но мне кажется тут будет что то другое. Вот похожий ответ нашел на просторах интернета. Но он тоже не работает.(((
function startVideo() { player = document.getElementById("player")
const mediaSource = new MediaSource()
const url = URL.createObjectURL(mediaSource)
player.src = url
mediaSource.addEventListener('sourceopen', sourceOpen)
}
async function sourceOpen() { let mediaSource = this
const videoSourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')
let fetchResult = await fetch(`/asset/video/${videoLocation}`)
let videoData = await fetchResult.arrayBuffer()
videoSourceBuffer.appendBuffer(videoData)
}
Answered by Alex_Verizhnikov on December 30, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP