How to Play FLV Video in HTML Video tags?

前端 未结 5 1367
夕颜
夕颜 2020-12-29 07:32

I have had a look at a couple of players like Flow Player, JW Player and a couple more but I can\'t get it to work exactly in PHP code.

Is there any way to play FLV

相关标签:
5条回答
  • 2020-12-29 08:14

    You might consider using some other players that are able to play FLV files; Known browsers (Chrome, Firefox etc...) are not able to run FLV files untill or unless you use some kind of flash player.

    1. If you are using PHP, you might want to use a flash player! Use Adobe Flash Player, don't be shy! YouTube and many other websites use it.

    2. You can also try to stick to the flayers you have already tried.

    3. You can convert videos to MP4 or format of OGG. So that every browser can play the video file using the HTML5 <video></video> tag.

    But Remember: Each browser has its own limitaion for playing a video file; you can read browser support here: Mozilla Developer Network

    0 讨论(0)
  • 2020-12-29 08:15

    Technically speaking the HTML5 video specification is codec/protocol agnostic so one could imagine support for flv files could be possible. Problem is: none of the major web browser has implemented it (probably because flv is a proprietary container from Adobe). You will need a flash component to play it back. Either one of the players you mentioned or if you are looking for a standalone free flash player try strobe from Adobe. You can try it here.

    If you can produce .f4v files you may have success in renaming them to mp4 and then try and play them in an HTML5 video tag.

    0 讨论(0)
  • 2020-12-29 08:16

    Play it with Flash. I think it is the only way: http://css-tricks.com/forums/topic/how-to-play-flv-in-html5/

    0 讨论(0)
  • 2020-12-29 08:19

    You can do it using flv.js or via MediaElement.js (that will use flv.js underneath), although the support is limited to FLVs that contain H.264 video with AAC/MP3 audio.

    Use MediaInfo software or your favorite video player to check what codecs are used in your FLVs.

    And if you have H.264 + AAC inside, you can also convert it to MP4 losslessly, without reencoding:

    ffmpeg -i input.flv -codec copy output.mp4
    
    0 讨论(0)
  • 2020-12-29 08:20

    You should look at video.js from www.videojs.com I have been using it streaming live video feeds. It mimicks the video tag like this:

    <video id="example_video_1" class="video-js vjs-default-skin"
     controls preload="auto" width="640" height="480"
     poster="http://video-js.zencoder.com/oceans-clip.png"
     data-setup='{"example_option":true}'>
    <source src="rtmp://localhost/live/test" type="rtmp/flv">
    </video>
    

    Works very well for me.

    0 讨论(0)
提交回复
热议问题