Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pausing a bandcamp embedded player in Javascript

Hey all I'm working on a project that would require the use of embedded players from bandcamp, youtube and soundcloud in a slideshow carousel.

I'm quite familiar with the youtube embed js api and the soundcloud one is by no means complicated but I can't seem to find any api for bandcamp that doesn't include getting an api key and invoking the api itself. I have no need for that. I just want to be able to pause the player with Javascript if someone goes beyond that slide so there isn't the sound playing while the slide isn't showing.

Any ideas or places to look to interface just with the bandcamp embed widget?

like image 364
Kobby Avatar asked Oct 05 '13 17:10

Kobby


1 Answers

This is a hack I worked around the issue.

Added a class="bandcamp_embed" to the embed iframe

and then using jQuery

$(".bandcampemb").each(function(i,t){
   var src_back = t.src;
   t.src = "random_blank.html";
   t.src = src_back;
});

I hope there is a better way in the future =]

like image 196
gateblues Avatar answered Nov 09 '22 12:11

gateblues