JSFiddle - React, Tailwind, and code Playground
by Neelima Karri
HTML
<div ng-app ng-controller="videoCtrl">
<video preload="preload" autoplay="autoplay">
<source src="http://www.w3schools.com/html/mov_bbb.mp4">
</video>
<button ng-click="playVideo($event)">
PLAY
</button>
</div>
CSS
div {
position:relative;
width:300px;
height:150px;
}
button {
position:absolute;
top:50px;
left:120px;
}
JavaScript
function videoCtrl($scope) {
$scope.autoplay = false;
$scope.preload = "none";
$scope.playVideo = function () {
console.log("hello");
$scope.autoplay = true;
$scope.preload = "auto";
}
}