Commit 5b98883b authored by Roman Karwacik's avatar Roman Karwacik

Merge branch 'patch-double-tap-seek' into 'master'

Double tap to seek +-15s

See merge request videoaginfra/website!24
parents 19ecc210 d72f7f4b
This diff is collapsed.
......@@ -37,6 +37,7 @@
<script src="{{url_for('static', filename='videojs/videojs-resolution-switcher.js')}}"></script>
<script src="{{url_for('static', filename='videojs/videojs.hotkeys.js')}}"></script>
<script src="{{url_for('static', filename='videojs/videojs-markers.js')}}"></script>
<script src="{{url_for('static', filename='hammer.min.js')}}"></script>
{% endblock %}
</head>
<body>
......
......@@ -64,6 +64,24 @@
$(function() {
$('#videoplayer').addClass("vjs-fluid");
$('#videoplayer').css("width");
var videoobj = document.getElementById("videoplayer");
var player = videojs("videoplayer");
var manager = new Hammer.Manager(videoobj);
var DoubleTap = new Hammer.Tap({
event: 'doubletap',
taps: 2
});
manager.add(DoubleTap);
manager.on('doubletap', function(e) {
if(e.center.x<(e.target.clientWidth/2)) {
player.currentTime(player.currentTime() - 15);
} else {
player.currentTime(player.currentTime() + 15);
}
});
videojs("videoplayer").ready(function() {
//resume
var progress_key = "progress_{{ lecture.id }}";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment