The Zurich release has arrived! Interested in new features and functionalities? Click here for more

HTML5 Video Autoplay not Working

HumanSky
Mega Guru

I'm trying to add the following HTML5 <video> attribute as a Service Portal widget as a background div video:

<video autoplay muted loop controls>

  <source src="//sample.com/path/to/video.mp4"></source>

</video>

Everything works fine, except for autoplay. Has anyone else ran into a similar issue?

1 ACCEPTED SOLUTION

HumanSky
Mega Guru

I was able to figure it out. Apparently Angular was ignoring some of the <video> attributes. However, moving the video source from <source> element to "ng-source" attribute seemed to do the trick. Here's the sample code:



  1. <video autoplay muted loop controls ng-src="//sample.com/path/to/video.mp4"></video>

View solution in original post

2 REPLIES 2

Inactive_Us1474
Giga Guru

Try :


  1. <video muted loop controls>  
  2.   <source src="//sample.com/path/to/video.mp4?autoplay=1"></source>  
  3. </video>

I tried with Iframe it worked with the embed tag.


HumanSky
Mega Guru

I was able to figure it out. Apparently Angular was ignoring some of the <video> attributes. However, moving the video source from <source> element to "ng-source" attribute seemed to do the trick. Here's the sample code:



  1. <video autoplay muted loop controls ng-src="//sample.com/path/to/video.mp4"></video>