理解:播放器会对本地视频在数据丢失时进行数据获取,每次消耗一次鉴权次数,次数为0是会出现播放出错的问题。
解决:因此修改这个次数即可,这里的代码没有做细致研究,可能存在错误
还是推荐大家使用云视频,如果需要阿里云、腾讯云视频点播的可以联系我,流量折合最低0.17每GB
文件:src/Biz/Player/Service/Impl/PlayerServiceImpl.php
函数:protected function makeToken($type, $fileId, $context = array())
protectedfunctionmakeToken($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;}