理解:播放器会对本地视频在数据丢失时进行数据获取,每次消耗一次鉴权次数,次数为0是会出现播放出错的问题。
解决:因此修改这个次数即可,这里的代码没有做细致研究,可能存在错误
还是建议大家使用云视频。如果需要阿里云或者腾讯云视频点播,流量相当于最低0.17/GB。
文件:src/Biz/Player/Service/Impl/PlayerServiceImpl.php
函数:protected function makeToken($type, $fileId, $context = array())
protected function makeToken($type, $fileId, $context = array())
{
$fields = array(
'data' => array(
'id' => $fileId,
),
'times' => 10, // 修改这个参数即可,可以理解为鉴权次数
'duration' => 3600,
'userId' => $this->getCurrentUser()->getId(),
);
if (isset($context['watchTimeLimit'])) {
$fields['data']['watchTimeLimit'] = $context['watchTimeLimit'];
}
if (isset($context['hideBeginning'])) {
$fields['data']['hideBeginning'] = $context['hideBeginning'];
}
$token = $this->getTokenService()->makeToken($type, $fields);
return $token;
}
. . .
相关推荐
热门推荐
xxl-job 配置警报电子邮件通知
30天前
Linux基本操作2
28天前
idea使用git版本控制上传提交代码
28天前
1096: C语言程序设计教程排序新问题
28天前
css layout
26天前
ads via 小工具