如何确定 YouTube 视频的长度? [英] How to determine the length of a YouTube video?

查看:45
本文介绍了如何确定 YouTube 视频的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简单的问题,但我没有这方面的经验,所以我想得到你的帮助.所以,问题是(正如标题所说):

This one is a simple question, but I have no experience in this topic, so I would like to use your help. So, the question is (as the title says):

如何确定 YouTube 视频的长度(以秒为单位)?

如果可以从 HTML 源获得此信息,那就太好了.但是任何其他想法都很好,我目前只是在集思广益地讨论一个新应用程序,其中视频的持续时间非常重要.

It would be great if this information is available from HTML source. But any other idea is good, I'm currently just brainstorming about a new application, where the duration of the videos is strongly important.

你有什么想法吗?

推荐答案

您可以使用 javascript youtube api.您可以在此链接上找到我们的更多信息https://developers.google.com/youtube/js_api_reference#Retrieving_video_information

You can use javascript youtube api. You can find our more on this link https://developers.google.com/youtube/js_api_reference#Retrieving_video_information

你在播放器上有方法的地方:

Where you have method on player:

player.getDuration()

这篇关于如何确定 YouTube 视频的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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