<script src="../../popcorn.js"></script>
<script src="popcorn.lastfm.js"></script>
- <script>
+ <script>
document.addEventListener('DOMContentLoaded', function () {
var p = Popcorn('#video')
.play()
start: 5, // seconds
end: 15, // seconds
artist: 'yacht',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 10, // seconds
end: 20, // seconds
artist: 'the beatles',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 15, // seconds
end: 30, // seconds
artist: 'sdfsdfsdfdsddfsdfsdfsddfsf',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 20, // seconds
end: 45, // seconds
artist: 'Coldplay',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 25, // seconds
end: 40, // seconds
artist: 'yacht',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
}, false);
</script>
* appended to, this target element must exist on the DOM
*
* @param {Object} options
- *
+ *
* Example:
var p = Popcorn('#video')
.lastfm({
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
- script.src = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ options.artist +"&api_key=30ac38340e8be75f9268727cb4526b3d&format=json&callback=lastFMcallback";
+ script.src = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ options.artist +"&api_key="+options.apikey+"&format=json&callback=lastFMcallback";
script.type = "text/javascript";
head.insertBefore( script, head.firstChild );
start: 1, // seconds
end: 4, // seconds
artist: 'yacht',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 2.5, // seconds
end: 7, // seconds
artist: 'the beatles',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} )
.lastfm({
start: 4.5, // seconds
end: 7, // seconds
artist: '',
- target: 'lastfmdiv'
+ target: 'lastfmdiv',
+ apikey: '30ac38340e8be75f9268727cb4526b3d'
} );
interval = setInterval( function() {