Skip to content

Instantly share code, notes, and snippets.

@ewnd9
Last active December 30, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewnd9/465c3837705fd71f6e42 to your computer and use it in GitHub Desktop.
Save ewnd9/465c3837705fd71f6e42 to your computer and use it in GitHub Desktop.
disable-vk-player snippet for preventing accidentally moving to next track
var superFn;
var mockFn = function(id) {
if (id === window.audioPlayer.id) {
superFn(id);
}
};
if (window.playAudioNew.toString() !== mockFn.toString()) {
superFn = window.playAudioNew;
window.playAudioNew = mockFn;
console.log('activated');
} else {
window.playAudioNew = superFn;
console.log('disactivated');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment