我正在查看 jwPlayer api,我找到了它提供插件来获取上传表单的方法,以便我的用户可以直接将他们的视频上传到我的 jwPlayer 帐户。
但我需要一些其他服务。实际上,我已经在文件夹中有视频列表,并且其列表也保存在数据库中(通过某些后台进程)。而且,我想使用一些(php)脚本将其上传到 jwPlayer 上,这样在每天结束时,当我收到当天的所有新视频(通过该后台进程)时,我可以运行该(php)脚本来获取所有这些新视频都上传到 jwPlayer 上。
提前致谢
最佳答案
使用 PHP API 适配器:https://github.com/jwplayer/jwplatform-php
示例:
$jwplatform_api = new Jwplayer\JwplatformAPI('INSERT API KEY', 'INSERT API SECRET');
$target_file = 'YOUR_VIDEO.mp4';
$params = array();
$params['title'] = 'PHP API Test Upload';
$params['description'] = 'Video description here';
// Create the example video
$create_response = json_encode($jwplatform_api->call('/videos/create', $params));
$decoded = json_decode(trim($create_response), TRUE);
$upload_link = $decoded['link'];
$upload_response = $jwplatform_api->upload($upload_link, $target_file);
print_r($upload_response);
关于jwplayer - 如何使用php脚本在jwplayer上上传视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32276225/