0

Hiii Everyone,

        In my project.I tried with html5 video tag.Below is the code

HTML code

<video autoplay loop muted poster="screenshot.jpg" id="v" width="100%" height="">
<source src="img/main.mp4" type="video/mp4">
</video>

it will be play continously in my website.This video is not playing in safari browser.For that i tried in some other way with embed.It is playing in safari

 <embed src="img/main.mp4" width="100%" height="" autoplay loop muted id="v" >
</embed>

But what the issue is while i tried with video tag it is like below picture.

enter image description here

After tried with embed tag it is like

enter image description here

What is the issue is when trying with video its is compatible with full width and height of desktop and in embed it showing in very small size and it is not playing continously.If anyone knows the solution of my problem.Please help me to get out of this issue.Thanks in advance.

Kavya Shree
  • 1,014
  • 2
  • 17
  • 52
  • Maybe specify file type to be video/mp4 in embed tag? –  Jun 30 '16 at 05:56
  • Ya i tried like that also.No difference is there – Kavya Shree Jun 30 '16 at 05:58
  • which safari ? mobile one or desktop one? Which version? What is the codec of your video? – Kaiido Jun 30 '16 at 06:11
  • Desktop version 5.34 – Kavya Shree Jun 30 '16 at 06:14
  • 1
    5.34??? Are you on windows? Apple itself stopped the support for this odd thing... You should stop using it right now as it contains a lot of known security vulnerabilities that won't get fixed ever. Current vesrion is Safari 9, only available on mac os. *note that I can't repro your issue with mine, but it may also come from your video file.* – Kaiido Jun 30 '16 at 06:25
  • Okay Kaiido. but why the video is showing very small. while try with embed tag compared to video tag – Kavya Shree Jun 30 '16 at 06:33

3 Answers3

0

You should add controls="true" for the tag. tag can not autoplay in iOS safari browser, and the default appearance is without controls has no play button.

If you don't want to use the default controls, you can create your control bar instead. Using methods of , such as .play() .pause(), to control the video.

LCB
  • 971
  • 9
  • 22
  • Why video is not showing to the whole page.How can i hide that play bar in safari – Kavya Shree Jun 30 '16 at 06:10
  • What does "showing to the whole page" mean ? You mean the – LCB Jun 30 '16 at 08:28
0

it needs height add style="min-height:300px"

<video autoplay loop muted poster="screenshot.jpg" id="v" width="100%" height="" style="min-height:300px">
<source src="img/main.mp4" type="video/mp4">
</video>
Daniel
  • 815
  • 1
  • 6
  • 13
0

you should also try height attribute in embedding. I hope it will solve your problem

<embed src="img/main.mp4" width="100%" height="auto" autoplay loop muted id="v" >