[隐藏" YouTube视频的载入屏幕 [英] "Hide" a YouTube Video's Loading screen

查看:173
本文介绍了[隐藏" YouTube视频的载入屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览



流式播放器: https ://flowplayer.org/docs/cuepoints.html



以及许多其他人可以查看。



video.js,popcorn.js 等等。


After looking through the YouTube IFrame API, I haven't been able to find anything that can help me.

My goal is to "hide" the loading screen a YouTube video has; i.e. this black screen with a spinning wheel. While it only appears for a brief second and doesn't bother me, it's bothersome when trying to use a YouTube as the background of an element.

My approach to solving this problem was to have a picture of the first frame of the YouTube video overlap the video and then hide it when video starts playing. I originally thought I'd be able to use onStateChange and watch for the YT.PlayerState.PLAYING value so I can hide the image but this event is triggered when it is about to start playing; in other words, it hides the images when the video is about to start playing which is when the loading screen appears.

Are there any other approaches to this or am I stuck with the brief loading screen or would a self-hosted video be the better approach? I wanted to avoid self-hosting the video because of bandwidth.

解决方案

Host the video and use an API where you can; customize the media player, hide / show / customize load screens, cue points, start poster / end poster, etc. Or else your spending your time hacking youtube API capabilities with funky javascript.

JW player: http://www.jwplayer.com/

Flow Player: https://flowplayer.org/docs/cuepoints.html

And many others you could check out.

video.js, popcorn.js, etc etc.

这篇关于[隐藏" YouTube视频的载入屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆