Streaming an mp4 through a php file progressively

后端 未结 5 1561
无人及你
无人及你 2021-02-09 13:45

I\'m working on a more secure streaming method for our video player. Because each file requires special token authentication and also only allows each token to be loaded once, I

5条回答
  •  佛祖请我去吃肉
    2021-02-09 14:21

    I think that you have a conceptual failure. You are treating the mp4 file like if it were a "raw data file". I try to explain myself.

    Imagine that you have a text file, and you want to get the chars from position X. You can open the file, point the cursor to the correct position and then read byte by byte your text. This will work fine.

    But now image that you want to do the same but with a text processor file. Would you expect the same results? No, because you have a lot of metadata in the file that prevents you from doing that.

    Your problem is basically the same. You need to take in consideration the format of the file, managing the file with libraries designed for it, or doing by yourself.

    The other option will be to work with raw data files, but in the case of video files, these are going to be really big files.

    I hope that I helped you.

提交回复
热议问题