Sunday, 30 May 2010

A little music

Looking at the code in home-screen.js I can see that it downloads from vieracast.eu (EU market) vieracast.tv (US market) depending on where you are. I used my download.sh script created earlier to download similar files from the US server and compared them. I noticed they have Amazon video player, Pandora music player etc. I tried to get these working, unfortunately they're restricted by geographical IP address. This can probably be proxies around, but for now I looked a the code and how Pandora plays music.

In home-screen.js, I added the following code after the function disconnect_bplayer(): -

disconnect_bplayer();

var pd_musicPlayer = new MusicPlayer({});
pd_musicPlayer.connect( AudioDev );
pd_musicPlayer.set_url( "http://www.mfiles.co.uk/mp3-downloads/Fur-Elise.mp3" );
pd_musicPlayer.play2();


This code disconnects the broadcast player (i.e. the embedded TV player in the middle of the screen) and plays a piece of music at the specified url in the background. Beautiful :D

I've tried this with various file formats, it works fine with mp3 and aac files. My hope was that it will be possible to point it to an internet radio stream, however it seems that the MusicPlayer() class is not happy with files that don't specify a content length :( It may be possible to spoof a length in the HTTP headers, but I haven't tried that as yet.

7 comments:

  1. It sounds like you're doing all this development and testing the results ON THE TV.

    Assuming the TV is running an HTTP-compliant browser, wouldn't it be easier to debug if you were to do your testing using your computer's browser - with a spoofed Vieracast-compatible user agent string, of course.

    Is it not possible to simulate the TV client with a normal web browser? What am I missing here?

    -Steve

    ReplyDelete
  2. It's JavaScript code, but it runs functions provided by the TV's API, therefore it won't run in a browser.

    ReplyDelete
  3. I have access to a VPS in the USA and run a VPN to it, so I will try tunnelling my 42g15's network traffic through it and see if I can get some interesting services to work

    thanks for taking the time to write this up, when I kicked off the AV Forums thread I though I'd have more time to play but sadly not.

    ReplyDelete
  4. p.s. a colleague found the best deal for a quality VPS in USA was at fivebean; set up shared key openVPN on the server and a local computer and a bit of routing magic and you're done ;-)

    ReplyDelete
  5. Unrelated to this particular post... but... Check out the menu: Settings/About/License. Mine has a link to: http://www.am-linux.jp/dl/DTV09U/. Linux source code!

    ReplyDelete
  6. Hi
    Any improvements on this ?

    I bought my Panasonic primarily for the quality of the plasma screen.. but would _really_ like to get some improvements on the Internet stuff....

    ReplyDelete
  7. Hi

    I have create a forum dedicated to discussion on vieracast development in the hope of gathering all information in one place.

    Check it out here:
    http://vieracast.hotsource.net/

    ReplyDelete