Search code examples
samsung-smart-tv

Samsung smart device information


I'm building an app that requires information about the device it's running on such as the manufacturer, the model, and what it supports (such as 3D, external controls (mouse, keyboard, etc...)) and so on.

On LG TVs I'm able to access this by referencing an DOM element and reading it's attributes: http://developer.lgappstv.com/TV_HELP/index.jsp?topic=%2Flge.tvsdk.developing.book%2Fhtml%2FAPI%2FAPI%2FProperties2.htm

How can I do this on Samsung devices?


Solution

  • Found it! Turns out one has to load $MANAGER_WIDGET/Common/af/2.0.0/loader.js and then you can access the deviceapis object. For example:

    if (deviceapis)
    {
        // ermagad
        deviceId = findKey(deviceapis.tv.info, deviceapis.tv.info.getProduct()) + '; ' +
            deviceapis.platform + '; ' +
            deviceapis.tv.info.getDeviceID() + '; ' +
            deviceapis.tv.info.getModel() + '; ' +
            deviceapis.tv.info.getFirmware() + '; ' +
            deviceapis.tv.info.getCountry() + '; ' +
            deviceapis.tv.info.getLanguage() + '; ' +
            deviceapis.tv.info.getVersion() + '; ' +
            findKey(deviceapis.displaycontrol, deviceapis.displaycontrol.get3DEffectMode()) + '; ' +
            findKey(deviceapis.audiocontrol, deviceapis.audiocontrol.getOutputMode());
    }