When on http://m.fatberris.com press the F12
-button and go to the console
-tab. Copy and paste the below script into the console and press enter, skip a song, and the link appears together with remaining time.
Last active
December 22, 2015 23:39
-
-
Save nwillems/6548211 to your computer and use it in GitHub Desktop.
Little script to provide link for the currently playing song on Berri radio(http://m.fatberris.com/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run me from your developer console and get a link to that sweet tune playing in your ears! | |
// Developer console accesible from either "file"-menu or F12 | |
var additionalInfo = $('<div>'); | |
additionalInfo.attr('id', "TuneLink"); | |
var timeInfo = $('<div>'); | |
timeInfo.attr('id', "Time"); | |
$('div[role=main]').append(additionalInfo, timeInfo); | |
$('#player').bind( | |
$.jPlayer.event.playing, | |
function(){ | |
$('#TuneLink').html( | |
$('<a>').attr('href', $('#player audio').attr('src')).text("Dat tune") | |
); | |
} | |
); | |
$('#player').bind( | |
$.jPlayer.event.timeupdate, | |
function(event){ | |
var status = event.jPlayer.status; | |
var remaining = Math.floor(status.duration - status.currentTime ); | |
$('#Time').html('Remaining time: ' + $.jPlayer.convertTime(remaining)); | |
} | |
); | |
//Allow right click | |
$(document).unbind("contextmenu") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment