sharing small pieces of rocks or jewels I find on the way

We use chromecast to see video from my laptop to TV. While pressing space would pause or play the video, there is no control for moving forward or moving backward. So I wrote a little javascript code

document.onkeydown = function(ev){if(ev.keyCode==37){document.body.firstChild.currentTime = document.body.firstChild.currentTime – 15} else if(ev.keyCode==39){document.body.firstChild.currentTime = document.body.firstChild.currentTime + 15}}

I run this code in console (pressing F12 and then selecting console and pressing enter after pasting) and then I can have keyboard control. Now if I press right arrow it goes 15 seconds ahead and pressing left goes back 15 seconds. If you don’t like 15, feel free to change the code to 10 and hit enter, it will be applicable instantly.

I haven’t been programming for very long time and have no idea how to make chrome extension. Should checkout, but don’t get enough time, too many things to read. So, wish to get it done by doing smallest possible 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: