var v = $("#vid");
var b = $("#progress");
var x = $("#draw_here");
var vidTimer;
var s;
//wait for video and tracks to load
var myVideoPlayer = $('#vid');
myVideoPlayer.on('loadedmetadata', function() {
$("#play_ball").draggable()
.bind('mousedown', function(event, ui) {
$(event.target.parentElement).append(event.target);
})
.bind('drag', function(event, ui) {
event.target.attr('x', ui.position.left);
});
//$("#play_ball").draggable({
// axis: "x",
// containment: 'parent'
//});
var videoControls = $('#videoControls'),
play = $('#play'),
playProgressInterval = false,
progressContainer = $("#progress"),
playProgressBar = $("#play_ball");
// Get rid of the default controls
v.attr('controls', "");
handleButtonPresses();
function handleButtonPresses() {
// When the play button is clicked, playor pause the video.
play.on('click', playPause, false);
// When the play button is pressed, witch to the "Pause" symbol.
v.on('play', function() {
play.title = 'Pause';
play.html('<span id="pauseButton">▐▐</span>');
// Begin tracking video's progress.
trackPlayProgress();
}, false);
// When the pause button is pressed, switch to the "Play" symbol.
v.addEventListener('pause', function() {
play.title = 'Play';
play.html('►');
// Video was paused, stop tracking progress.
stopTrackingPlayProgress();
}, false);
// When the video has concluded, pause it.
v.on('ended', function() {
this.currentTime = 0;
this.pause();
}, false);
v.on('touchstart', function(e) {
var sDate = new Date();
sTime = sDate.getTime();;
var touchobj = e.changedTouches[0]
console.log(touchobj.target) // returns element touch point landed on
// var xPos =
// var yPos =
// console.log("position is"+e.PageX + ", " + e.PageY);
//...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.