this content was originally posted here.

video embed no controls

embed a video, for use as a background or a slide element, or wherever you need a large video.

I found that there was a bug in chrome (which is probably fixed now) that was ignoring the autoplay tag so had to add some js to play the video, this one seems to be working ok with no js to play the video, so must have been some other library on the page that was causing the issue.

note: the video is compressed quite a lot so saves a bit of space

example

code

<style>
video {
  width: 100%    !important;
  height: auto   !important;
}
.video-wrap {
	overflow:hidden;
	height:400px;
}	
</style>

<div class='video-wrap'>
	<video id="desk" loop autoplay>
		<source src="video/blurred-bokeh-video.webm" type="video/webm">
	</video>
</div>

here is the js to grab the video and play it after the doc loads, usually add the set timeout to a doc ready. but this is not used here as i didnt have the issue.

function video_play() {
    video = document.getElementById('desk');
    var isPlaying = video.currentTime > 0 && !video.paused && !video.ended && video.readyState > 2;

    if (!isPlaying) {
      video.play();
    }
}
setTimeout(video_play, 1000);

Demo

database file: /home/kruxor/Dropbox/ssl.kruxor.com/root/kruxor.com/db/db.db
comments_dbfile: /home/kruxor/Dropbox/ssl.kruxor.com/root/kruxor.com/db/comments.db ($db_comments)
views_dbfile: /home/kruxor/Dropbox/ssl.kruxor.com/root/kruxor.com/db/views.db
$dbfood_file: /home/kruxor/Dropbox/ssl.kruxor.com/root/kruxor.com/db/food.db
db_linx: /home/kruxor/Dropbox/ssl.kruxor.com/root/kruxor.com/linx/db/db.db
Classes Loaded:
class/answers.class.php
class/code.class.php
class/comments.class.php
class/content.class.php
class/core.class.php
class/crud.class.php
class/crumbs.class.php
class/featured.class.php
class/food.class.php
class/functions.class.php
class/images.class.php
class/import.class.php
class/links.class.php
class/questions.class.php
class/template.class.php
class/tv.class.php
class/user.class.php
class/utilities.class.php
class/views.class.php
class/widget.class.php
Class Extend Loaded: class/extends/expenses.extend.php
Class Extend Loaded: class/extends/gary_cummins_timeline.extend.php
Class Extend Loaded: class/extends/moo.extend.php
Class Extend Loaded: class/extends/osrs_item_data.extend.php
Class Extend Loaded: class/extends/osrs_slayer.extend.php
Class Extend Loaded: class/extends/osrs_slayer_monsters.extend.php
Class Extend Loaded: class/extends/searches.extend.php
Core Database Connected: expenses.db
expenses add_to_menu:
Class Extend Auto Initialized as: expenses
Core Database Connected: gary_cummins_timeline.db
gary_cummins_timeline add_to_menu:
Class Extend Auto Initialized as: gary_cummins_timeline
Core Database Connected: moo.db
moo add_to_menu:
Class Extend Auto Initialized as: moo
Core Database Connected: osrs_item_data.db
osrs_item_data add_to_menu:
Class Extend Auto Initialized as: osrs_item_data
Core Database Connected: osrs_slayer.db
osrs_slayer add_to_menu:
Class Extend Auto Initialized as: osrs_slayer
Core Database Connected: osrs_slayer_monsters.db
osrs_slayer_monsters add_to_menu:
Class Extend Auto Initialized as: osrs_slayer_monsters
Core Database Connected: searches.db
searches add_to_menu:
Class Extend Auto Initialized as: searches
$user_logged_in:
user access level:
pages:
$p1:view
$p2:code
$p3:Vv3Qx
$p4:video-embed-no-controls
$p5:
$p6:
$p:/view/code/Vv3Qx/video-embed-no-controls/
Using Template: view-code.html