PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 15, 2022

[FIXED] How to autoplay local video with iframe?

 April 15, 2022     html, iframe     No comments   

Issue

There are many solutions out there on how to make youtube/vimeo autoplay a video but they don't seem to work on a local video:

<template>
  <section id="vision" class="vision">
    <iframe src="videos/cgi_neutral.mp4?autoplay=1" allow="autoplay" allowfullscreen="true"></iframe>
  </section>
</template>

This does not autoplay.


Solution

First, instead of using an iframe, use a <video> tag. (Because its self-hosted on your website, no need to use an iframe) To make it autoplay, just add the "autoplay" attribute.

For Example:

<video width="320" height="240" controls autoplay>
 <source src="movie.mp4" type="video/mp4">
</video>


Answered By - Marcus
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing