html5-video

Stream HLS on safari using MediaSource api

半腔热情 提交于 2020-12-09 23:25:45
问题 I want to stream HLS fragments using media source extension. I have tried the same using mpeg-dash fragments (generated using MP4Box) and media source extension. var mediaSource = new window.MediaSource(); mediaSource.addEventListener('sourceopen', _onSourceOpen); $('video').attr('src', URL.createObjectURL(self.mediaSource)); function _onSourceOpen() { sourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs="avc1.64000d,mp4a.40.2"'); } function _onFragmentDataLoad(data) { sourceBuffer

Stream HLS on safari using MediaSource api

旧城冷巷雨未停 提交于 2020-12-09 23:08:14
问题 I want to stream HLS fragments using media source extension. I have tried the same using mpeg-dash fragments (generated using MP4Box) and media source extension. var mediaSource = new window.MediaSource(); mediaSource.addEventListener('sourceopen', _onSourceOpen); $('video').attr('src', URL.createObjectURL(self.mediaSource)); function _onSourceOpen() { sourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs="avc1.64000d,mp4a.40.2"'); } function _onFragmentDataLoad(data) { sourceBuffer

How to generate HTML5 video volume level chart?

别等时光非礼了梦想. 提交于 2020-12-06 11:50:31
问题 Given a plain web video of say 30s: <video src="my-video.mp4"></video> How could I generate its volume level chart? volume| level| ****** | * * ** | * * * ** |** * *** * | ** * * * * +---------------*-*-----************------+--- time 0 30s video is and quiet loud here here Note: Plain JavaScript, please. No libraries. 回答1: There are several ways to do this depending on what the usage is. For accuracy you could measure in conventional volumes and units such as RMS, LUFS/LKFS (K-weighted,

Trying to stream telegram media and playing it in a web page

安稳与你 提交于 2020-12-05 11:52:07
问题 I am trying to stream Telegram video files and play them on a web page. I am using this script to stream Telegram videos to a web server. It uses Telethon and AIOhttp to stream the file. The streaming part can be seen here. I am currently serving it on a server to serve media files. The videos can be downloaded using the link the script provides and can be streamed on any media player. But when I try to stream them on a web page, it has problems. For mp4 videos, Chrome does not play them

Why video.requestPictureInPicture() works only once?

て烟熏妆下的殇ゞ 提交于 2020-11-29 10:40:25
问题 I'm trying enter and exit PIP mode of video via Javascript onscroll function and I can only once enter and exit this mode. Here's my codepen: `if (!myVideo.paused && myVideo.currentTime > 0 && !myVideo.ended && !isVideoPIP) { console.log('runPip') myVideo.requestPictureInPicture() .then(()=>{isVideoPIP = true;}) .catch(e=>console.log(e.message)); }` https://codepen.io/Greggg/pen/WBdeJG Second time I have this error message "Must be handling a user gesture if there isn't already an element in

Why video.requestPictureInPicture() works only once?

家住魔仙堡 提交于 2020-11-29 10:36:50
问题 I'm trying enter and exit PIP mode of video via Javascript onscroll function and I can only once enter and exit this mode. Here's my codepen: `if (!myVideo.paused && myVideo.currentTime > 0 && !myVideo.ended && !isVideoPIP) { console.log('runPip') myVideo.requestPictureInPicture() .then(()=>{isVideoPIP = true;}) .catch(e=>console.log(e.message)); }` https://codepen.io/Greggg/pen/WBdeJG Second time I have this error message "Must be handling a user gesture if there isn't already an element in