Lets say I have a music site that a user can add a youtube URL in a box and then the video will play.
Is it possible to have the background of that page change based on search parameters in the field.
So if a user puts in a Daft Punk video, could I have my site query a website with fan art and load the fan art as the background of that page?

EDIT: To elaborate more.

Popular media players (PLEX and XBMC) will often "srape" websites for information about tvshows, movies, and artists. They pull the content (biography, rating, fanart, etc.) from the different sites (imdb etc.) and display them in the media player.

I want to extend this functionality to my site.

Now this is where it could get complicated.

My website has an emfield that allows users to paste the URL's of different videos from youtube, vimeo and others that will display one video then create a playlist of the pending videos in the list.

Fortunately the emfield can also pull the artist and song title of the video from youtube. I want to use this information to then query a search on a website such as fanart.tv and pull an image or even corresponding artist information and display said information on my site as the corresponding song is playing.

In short:
1. URL is entered
2. Emfield displays video, artist, and song title
3. Somehow a search is performed on a website to locate that same artist and display fanart and other artist biography information
4. Listen and learn.

  • Can you please elaborate your question? If possible give some examples(field URL and Search parameters).
    – Inizio
    Commented Jan 29, 2014 at 12:14
  • Updated my original post with more information.
    – rborgeous
    Commented Jan 30, 2014 at 20:57

1 Answer 1


You can do this but its probably more of a jquery problem than a Drupal one since you're changing the background of the page based on an asynchronous web call. Rough idea of how this would look:

  • attach an onsubmit handler to your form that would load the video from the url
  • add your logic to find the artist from this url (?) and then find the appropriate image
  • then modify the body background using this image, ex:

    $('body').css('background-image', 'url(' + imageUrl + ')');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.