Skip to content

chronolai/HTML5Player

Repository files navigation

HTML5Player

Include

<link href="stylesheets/style.css" rel="stylesheet" type="text/css" />
<script src="javascripts/video-player.js"></script>

Howto

<script>
  document.body.onload = function() {
    player = new VideoPlayer('#player', {
      width: '100%',
      height: '360px',
      title: 'Big Buck Bunny',
      url: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4',
      cover: 'https://peach.blender.org/wp-content/uploads/bbb-splash.png'
    });
  };
</script>

Hotkey

Action Key
Play / Pause Space
+10s
-10s
Volume up
Volume down

Mouse

Action Event
Play / Pause Click
Fullscreen Double click

For developer

$ npm install && gulp serve

will start a local development server

Todo list

  • add customize event listener => addEvents(event, callback[, object])
  • implement getVideo method to access video tag
  • implement controls panel
  • default theme & change theme