How to open .mov format video in HTML video Tag?

后端 未结 7 978
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 06:20

I want to play .mov video like as this, but video doesn\'t play in any browser.

相关标签:
7条回答
  • 2020-12-14 06:36

    You can use Controls attribute

    <video id="sampleMovie" src="HTML5Sample.mov" controls></video>
    
    0 讨论(0)
  • 2020-12-14 06:42

    in the video source change the type to "video/quicktime"

    <video width="400" controls Autoplay=autoplay>
      <source src="D:/mov1.mov" type="video/quicktime">
    </video>
    
    0 讨论(0)
  • 2020-12-14 06:47

    Instead of using <source> tag, use <src> attribute of <video> as below and you will see the action.

    <video width="320" height="240" src="mov1.mov"></video>
    

    or

    you can give multiple tags within the tag, each with a different video source. The browser will automatically go through the list and pick the first one it’s able to play. For example:

    <video id="sampleMovie" width="640" height="360" preload controls>
        <source src="HTML5Sample_H264.mov" />
        <source src="HTML5Sample_Ogg.ogv" />
        <source src="HTML5Sample_WebM.webm" />
    </video>
    

    If you test that code in Chrome, you’ll get the H.264 video. Run it in Firefox, though, and you’ll see the Ogg video in the same place.

    0 讨论(0)
  • 2020-12-14 06:47

    Content Type for MOV videos are video/quicktime in my case. Adding type="video/mp4" to MOV video file solved issue in my case.

    <video width="400" controls Autoplay=autoplay>
      <source src="D:/mov1.mov" type="video/mp4">
    </video>
    
    0 讨论(0)
  • 2020-12-14 06:47

    Unfortunately .mov files are not supported with html5 video playback. You can see what filetypes are supported here:

    https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats

    If you need to be able to play these formats with your html5 video player, you'll need to first convert your videofile--perhaps with something like this:

    https://www.npmjs.com/package/html5-media-converter

    0 讨论(0)
  • 2020-12-14 06:50

    You can use below code:

    <video width="400" controls autoplay>
        <source src="D:/mov1.mov" type="video/mp4">
    </video>
    

    this code will help you.

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