Timing of YoutubeLive Dashboard video display - youtube-livestreaming-api

I'm under development iOS RTMP Client library(https://github.com/shogo4405/lf.swift)
Dashboard(https://www.youtube.com/live_dashboard) takes a time to appear video when start publishing.
The status is Online but the live video appears after seconds as below.
For
30FPS -> 5sec
15FPS -> 10sec
Is this YouTube specifications?
Is there any way to display shortly (3sec...) ?

Related

Use getDisplayMedia to record the screen, when the microphone is added from the system, there is no sound!

In chrome browser, I am using MacBook to record a 30 minutes class, in code, use getDisplayMedia to get the screen stream:
navigator.mediaDevices.getDisplayMedia({audio:true,video:true}).then((mediaStream)=>{
mediaRecorder = new MediaRecorder(mediaStream,{mineType:'video/webm'})
})
2.When the recording started 5 minutes later, I connected an external microphone to the MacBook, then lectured through the microphone, and then hoped that my voice would be recorded through the microphone, but the strange thing is that since the microphone is connected, there is no recording screen behind The sound is down, what’s the matter, how can I operate so that I can continue recording when switching microphones?

HLS Player: Clear video.js buffer on click

I have two live videos feeding an encoder which creates H.264 chunk files and an HLS manifest which is being served by an apache web server.
A browser page using video.js shows a player. Pressing "play" on the browser properly plays the video. It works well.
However, if we change video sources (by flipping the switch in the picture below), there is a considerable delay (10 seconds) before the new content is displayed in the player. I'd like to get that to 3 seconds.
It appears that video.js and/or the HTML5 player in browser is buffering that amount of content. (if you delete the files on the web server, kill apache, or even pull the ethernet cable, the video keeps on playing!)
A button on the web page controls the switch. When clicked, I would also like to clear or reset the player so that it immediately re-reads the index.m3u8 manifest and downloads the new chunks.
So far, haven't found anything promising searching the internet or in the video.js API docs. There are lots of articles on API calls for fetching the current buffer percentage but cannot find any API for clearing it altogether.
Any ideas?
The encoder is set for 3 second chunks and the playlist depth is set for 10 entries.
I had a similar problem. Since i could not find a reliable API for this, i came up with a rather dirty workaround to clear the buffer:
var ctime = player.currentTime();
player.currentTime(0);
player.currentTime(ctime);
This currently works for me in all major browsers.

Safari not retrieving mp4 video from cache, and sometimes timeout when downloading the same resource

I'm running a VueJS application that displays a full screen story of videos. I don't create as many tag as number of media in my story : I'm just changing component video sources each time I play a new video.
But it looks like Safari (Desktop & mobile) still does not cache HTML video once loaded : when I'm playing again a previous media, Safari is downloading again the asset. Instead of getting from cache like Chrome does.
The same issue has already been reported here but sill no correct answer.
Safari even stops downloading the final bytes video (producing a sort of timeout) when we go back and forth quicky in the story, so the story looks stuck.
Here's an example link.
Does anyone know a good alternative that avoids re-downloading video data at each play on Safari ?
Partial solution
Found myself a workaround that works pretty well if video is small size - all video are less than 3Mb in my case.
The trick is to use js fetch API to download full video, then stream it into video tag.
const videoRequest = fetch("/path/to/video.mp4")
.then(response => response.blob());
videoRequest.then(blob => {
video.src = window.URL.createObjectURL(blob);
});
Contrary to video src attribute, fetch API will get video data from cache if the same video was already fetched before.
Here a codepen demo that can be tested in Safari desktop/mobile (when NOT in private mode).
Pro : Video are now pulled from cache in Safari !
Con : You can't start the video until full data has been downloaded. That's why this solution can be used only for small video (like < 5Mb), else your users may wait a while before being able to play the video.

Youtube playback stopped after few minutes

I am integrating the youtube(Webkit) feature in my STB, but the video playback stops after few minutes.
In this problematic case the browser does not call any append source buffer.
What could be the problem?

Main content starts playing before preroll in video.js when using videojs-contrib-ads

When using videojs-contrib-ads to create an ad plugin in video.js, the main programme often starts playing before the ads start playing. It seems that video.js connects to the CDN of the main content initially and then contrib-ads checks if it needs to play prerolls. A few seconds of the main content is sometimes played before this happens and only then does it start to play the adverts.
This was seen mostly on iOS on live feeds.
Does anyone know why it works like this and is there a way to stop it?
Use the prerollTimeout setting.
The maximum amount of time to wait for an ad implementation to initiate a postroll, in milliseconds. If contentended has been fired and the ad implementation does not call startLinearAdMode() before postrollTimeout expires, the content video will end playback.