playing sounds on samsung smart tv
javascript, samsung-smart-tv
Solution
You need to add player object (`SAMSUNG-INFOLINK-PLAYER`) into your `<body>` tag:
<object id="pluginPlayer" style="visibility: hidden; width: 0px; height: 0px; opacity: 0.0" classid="clsid:SAMSUNG-INFOLINK-PLAYER"></object>
And then in the app's javascript just use this function:
var playerObj = document.getElementById('pluginPlayer');
playerObj.Play("absolute_url_to_your_mp3");
As Player plugin executes in different location inside Samsung's filesystem you need always use absolute path to the file. It can be remote one, but you can use `location.href` of you app's `index.html` to get absolute local path of app's working directory where you can put the mp3s.
Check the documentation, here:
http://www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_2.5/API_Reference/JavaScript_APIs/Device_API/Player
Problem
I am developing a simple game for samsung smart tv. I want to play little sound files when certain things happened like ready, win, lose. I don't want to deal with flash players, player controls .. Is there a way to use javascript to trigger a play sound action with a predefined sound volume and i nwant to do this several times in my code.