Question

I am creating an application for a Samsung Smart TV. In my app, I need to get the Smart TV's IP address. Does anyone know how to get it?

Was it helpful?

Solution

You need to use the SEF NETWORK to do that, make sure you're include this line in index.html

<object id='pluginObjectNetwork'    classid='clsid:SAMSUNG-INFOLINK-NETWORK'    style='opacity:0.0; background-color:#000000;width:0px;height:0px;'></object>

Then somewhere in your code you can use function:

var GetIPAddress = function(){
    var network = document.getElementById('pluginObjectNetwork');
    return network.GetIP(network.GetActiveType());  
};

More information can be read at samsung docs: http://samsungdforum.com/Guide/ref00014/sef_plugin_network.html

OTHER TIPS

For Tizen TV, you can get IP address from webapis, i.e.,

webapis.network.getIp()

will return you the IP address of the device.

Include webapi's in your index.html as :

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>



You can find more details related to Network of Tizen TV on the below mentioned Link:

http://developer.samsung.com/tv/develop/api-references/samsung-product-api-references/network-api

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top