Mike Eghtebas
asked on
Player button shape
Q1: How can have player button on the right (shown in the above image)?
Q2: How can I change the code such that, the player box will be minimized after the video finishes after 5 second delay?
<script>
$(function() {
$('video').on('play', function (e) {
// IGNORE PLAY EVENT IF ALREADY RESIZED
if ($(this).data('oldheight') > 0) return;
// SAVE THE CURRENT HEIGHT
$(this).data('oldheight', $(this).height());
// GET THE NEW HEIGHT DEFAULT TO 400 IF NOT SET
var newheight = $(this).data('height') || 400;
// SET THE NEW HEIGHT
$(this).css({height: newheight + 'px'});
});
$('video').on('ended', function (e) {
// GET THE OLD HEIGHT DEFAULT TO 100 IF NOT SET
var oldheight = $(this).data('oldheight') || 100;
// SET THE DEFAULT HEIGHT
$(this).css({height: oldheight+ 'px'});
// RESTORE THE FULL HEIGHT VALUE
$(this).data('oldheight', 0);
});
});
</script>
<video height="28" controls data-height="300">
<source src="http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are most welcome.
ASKER
Mike