Check if YouTube video is live or uploaded(检查 YouTube 视频是直播还是上传)
问题描述
我有一个 YouTube 直播活动.我可以使用 YouTube IFrame Player API 播放视频.我想知道是否有任何方法可以找到视频是现场活动视频还是常规上传的视频.我需要这些信息来设计我的控件.
I have a YouTube Live Event. I am able to play the video using the YouTube IFrame Player API. I want to know if there is any way that I can find if the video is a Live event video or a regular uploaded video. I need this information for designing my controls.
推荐答案
(目前)您可以做到这一点的唯一方法是使用 youtube 后端 api.根据视频 ID 获取有关视频的数据,并且在响应中您有一个 snippet.liveBroadcastContent 属性,该属性可以是 live、none 或即将到来的.
The only way you can do this (currently) is with youtube backend api.
Get data about the video based on its id and in the response you have a property snippet.liveBroadcastContent which is either live, none, or upcoming.
这篇关于检查 YouTube 视频是直播还是上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:检查 YouTube 视频是直播还是上传
基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
