【问题标题】:VideoStream external URL mp4 file in PHPPHP 中的 VideoStream 外部 URL mp4 文件
【发布时间】:2021-06-01 06:09:07
【问题描述】:

请帮我处理这个 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;

VideoStream.php文件

请帮助我在 html5 视频中处理该视频流。谢谢。

【问题讨论】:

    标签: php video-streaming html5-video mp4


    【解决方案1】:

    如果您只想使用 PHP 将视频文件字节提供到 HTML5 &lt;video&gt; 中,请尝试:

    (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;
    ?>
    

    【讨论】:

    • 非常感谢。 . 像魅力一样工作 :) 但不能向前或向后寻找。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    • 2015-04-22
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 1970-01-01
    相关资源
    最近更新 更多