如何获取 vimeo 视频的长度?
我有一个大问题。问题是如何获取vimeo视频的时长?这是场景。
我在此字段中有一个输入字段,表示我现在输入 YouTube 网址 验证视频长度只能为 1 分钟,如果是,那么我 将其存储在数据库中,否则我会显示错误消息。
是否可以对 vimeo 视频文件执行此操作?
I am having a big problem. Problem is how to get the time duration of vimeo video? Here is the scenario.
I have a input field in this field say i enter youtube url now i want
to put a validation that video should only be of 1 min, if yes then i
store this in database else i show an error message.
is it possible to do this thing for vimeo video files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
用法
功能
Usage
Function
Vimeo 现在有一个新的 API,请在此处查看:
vimeo api
,您所需要的只是:
1. 在您的 vimeo 帐户下创建一个应用程序 https://developer.vimeo.com/apps< br>
2. 获取您的 vimeo 应用程序的 client_id、client_secret、client_token;
3. 使用官方库之一(php、python、node): https://github.com/vimeo
这非常简单,但不要忘记优化我们的 API 调用,如下所示,因为 vimeo api 有速率限制:
https://developer.vimeo.com/api/common-formats#json-过滤器
Vimeo now has a new API, check here:
vimeo api
and all you need is :
1. create a app under your vimeo account here https://developer.vimeo.com/apps
2. get your client_id, client_secret, client_token of your vimeo app;
3. use one of those official lib(php, python, node): https://github.com/vimeo
it is very easy but don't forget to optimise our API call as here says because vimeo api has a rate limit:
https://developer.vimeo.com/api/common-formats#json-filter
是的,事实上它在他们的
Simple API
http:// vimeo.com/api/docs/simple-api
Yes, as a matter of fact its in their
Simple API
http://vimeo.com/api/docs/simple-api
根据视频的不同,您可能需要进行身份验证。
这是我制作的代码:
可以在此处请求授权代码。
Depending on the video, you might have to authenticate.
Here is a code I've made:
The authorization code can be requested here.
// 以秒为单位返回
// return in seconds