cakephp 3响应带有文件和视频标签
cakephp 3 response withFile and video tag
我已使用此代码通过 CakePHP 中的操作发送视频:
$response = $this->response->withFile(WWW_ROOT.'Component.webm',['download' => false]);
和内部模板:
<video class="img-responsive" controls>
<source src="<?= Router::url(['controller' => 'posts', 'action' => 'stream', $id]) ?>" />
</video>
在 Microsoft Edge 中一切正常。但是当我查看 Google Chrome 内的页面并开始播放视频时,我无法访问我网站的任何其他页面,直到视频完全下载,并且在 30 秒后,如果视频不下载显示此错误:
Maximum execution time of 30 seconds exceeded
我在这里发现了问题:
https://gist.github.com/ranacseruet/9826293#gistcomment-2141349
我在操作之上使用了 session_write_close();
,现在 chrome 也可以了。
我已使用此代码通过 CakePHP 中的操作发送视频:
$response = $this->response->withFile(WWW_ROOT.'Component.webm',['download' => false]);
和内部模板:
<video class="img-responsive" controls>
<source src="<?= Router::url(['controller' => 'posts', 'action' => 'stream', $id]) ?>" />
</video>
在 Microsoft Edge 中一切正常。但是当我查看 Google Chrome 内的页面并开始播放视频时,我无法访问我网站的任何其他页面,直到视频完全下载,并且在 30 秒后,如果视频不下载显示此错误:
Maximum execution time of 30 seconds exceeded
我在这里发现了问题: https://gist.github.com/ranacseruet/9826293#gistcomment-2141349
我在操作之上使用了 session_write_close();
,现在 chrome 也可以了。