如何解决PHP 中的 VideoStream 外部 URL mp4 文件
请帮我处理这个 VideoStream,因为它不起作用。
我有视频链接 http://91.121.207.115/downloads/American.Traitor.The.Trial.of.Axis.Sally.007.BR.mp4
但它不能在普通的 html5 视频中播放
然后我来到这里并且它工作正常。 https://codesamplez.com/programming/php-html5-video-streaming-tutorial
我已经尽力了,但仍然无法工作。
index.PHP
<video width="320" height="240" controls>
<source src="stream.PHP" type="video/mp4">
</video>
stream.PHP
include "VideoStream.PHP";
$stream = new VideoStream("http://91.121.207.115/downloads/American.Traitor.The.Trial.of.Axis.Sally.007.BR.mp4");
$stream->start();exit;
请帮助我在 html5 视频中处理该视频流。谢谢。
解决方法
如果您只想使用 PHP 将视频文件字节提供到 HTML5 <video>
中,请尝试:
(1) index.php: (可以是index.html
)...
<video width="640" height="400" controls>
<source src="stream.php" type="video/mp4">
</video>
(2)stream.php:
<?php
$file = "http://91.121.207.115/downloads/American.Traitor.The.Trial.of.Axis.Sally.007.BR.mp4";
$contents = readfile( $file );
echo $contents; //# send back to HTML...
exit;
?>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。