如何获取三星智能电视的 IP 地址

Pri*_*iya 2 samsung-smart-tv smart-tv

我正在为三星智能电视创建一个应用程序。在我的应用程序中,我需要获取智能电视的 IP 地址。有谁知道如何获得它?

小智 5

您需要使用 SEF NETWORK 来执行此操作,请确保将此行包含在 index.html 中

<object id='pluginObjectNetwork'    classid='clsid:SAMSUNG-INFOLINK-NETWORK'    style='opacity:0.0; background-color:#000000;width:0px;height:0px;'></object>
Run Code Online (Sandbox Code Playgroud)

然后在代码中的某个位置您可以使用函数:

var GetIPAddress = function(){
    var network = document.getElementById('pluginObjectNetwork');
    return network.GetIP(network.GetActiveType());  
};
Run Code Online (Sandbox Code Playgroud)

更多信息可以阅读三星文档:http://samsungdforum.com/Guide/ref00014/sef_plugin_network.html