我正在使用这个 javascript 函数来检查三星电视上的网络
Main.CheckConnection = function () {
// if(gKeyValues.IsOnTV){
// Main.Print("Production environment-------");
/* For Production Environment */
var physicalConnection = 0,
httpStatus = 0;
var currentInterface = networkPlugin.GetActiveType();
// If no active connection.
if (currentInterface == -1) { //wired=1,wireless=0,no connection=-1
return false;
}
// Check physical connection of current interface.
physicalConnection = networkPlugin.CheckPhysicalConnection(currentInterface);
// Main.Print("Network Status: " + physicalConnection);
// If not connected or error.
if (physicalConnection != 1) {
//Main.okDialog_Init("Message");
Main.Print("Network disconnected");
// Main.IsNetworkActive = false;
return false;
}
// Check HTTP transport.
httpStatus = networkPlugin.CheckHTTP(currentInterface);
// If HTTP is not avaliable.
if (httpStatus != 1) {
alert("Network disconnected");
Main.IsNetworkActive = false;
return false;
}
Main.IsNetworkActive = true;
return true;
// }
};
并将此插件包含在您的 HTML 页面中
<object id="pluginObjectNetwork" border=0 classid="clsid:SAMSUNG-INFOLINK-NETWORK" style="width: 0px; height: 0px;"></object>
请根据您的要求修改此功能此功能解决samsun中的所有网络和互联网相关问题