Page 1 of 1

Identifying device and hls streaming

PostPosted: Sat Jun 14, 2014 2:48 am
by blagojco.0712_1
Hi,

I'm working on SmartTv app for live streaming and I need to identify the device. As I read that is imposible to get mac address or serial number of the device. What is best solution for identifying the device? I was thinking of generating my own id, but I don't know hot to store that.

Also I want to know what is best solution for hls and vod streaming? I'm using html

Identifying device and hls streaming

PostPosted: Sun Jun 15, 2014 6:54 pm
by Support_STA
Hi,

The current STA spec does not include a function to retrieve an unique device ID or the TV's MAC address.
Maybe you can do it by cookie or [/color]HTML5 Web Storage[color=#222222]. Did you try it?

Regards,
STA Support

Identifying device and hls streaming

PostPosted: Sat Jun 21, 2014 7:12 am
by blagojco.0712_1
Hi,
thanks for your answer. I tried with cookie and everything is ok when I try to reload the app, but when I close the app and restart again, the cookie not exist anymore. I set the cookie with jquery with expiries date for 10 years:

$.cookie(\"userId\", 123456, {expiries:3650});

I'm working with simulator.

P.S. Running on real device is possible only when the app is ready for publishing?

Regards,
Blagojco

Identifying device and hls streaming

PostPosted: Sun Jun 22, 2014 11:38 pm
by Support_STA
Hi,

I didn't try cookie before, so I'm not sure about that.
Did you try localStorage of HTML5? Just like below:
if(typeof(Storage) !== \"undefined\") {
//Do anything you want
//var abc =localStorage.getItem(\"dataStored\");
//localStorage.setItem(\"dataStored\", \"Test Data\")
} else { //Log something}
I have a quick try with localStorage and it worked on both TV models and emulator.
I didn't find any official document about expiring of localStorage, maybe you should keep a json object (contain expire property or something like that) to control expiring.

Besides that, emulator can't replace all TV features, you can't depend on it much.

Hope this help!

Regards,
STA Support

Identifying device and hls streaming

PostPosted: Sat Jun 28, 2014 2:07 am
by blagojco.0712_1
Hi,
thanks for the answer. I solved with the local storage. Here is my example for someone else

var userId = localStorage.getItem(\"userId\");

if(userId === null)
{
localStorage.setItem(\"userId\", \"user_\" + new Date().getTime());
userId = localStorage.getItem(\"userId\");
}

Regards,
Blagojco

Identifying device and hls streaming

PostPosted: Fri Dec 19, 2014 1:56 am
by dsver_1
localStorage is definitely the best solution; I too store the device serial in localStorage and it works like charms on LG and on some other brand's device.
As for expiration date of localStorage, I read that it's \"forever\", we'll see about that :)
However, about your general question - regarding MAC or serial number of the device; how do you retrieve it? What's the value that you store in localStorage/cookie?
(As I read, WebOS doesn't have a support to read MAC nor any device identification)
I generate a 32-bit GUID and store that value, since I don't have any other solution :/

Identifying device and hls streaming

PostPosted: Fri Feb 20, 2015 10:35 am
by dragan.obrenovic_1
Here is a code snippet that works on my LG Smart TV (32LB580V)

Somewhere in your HTML code:
type=\"application/x-netcast-info\"
id=\"deviceInfo\"
width=\"0\"
height=\"0\"
style=\"float: left\">


In JavaScript:
device = document.getElementById('deviceInfo');
deviceInfo = device.manufacturer + ' ' + device.modelName;
serialNo = device.serialNumber;
version = device.swVersion + ' (HW Ver: ' + device.hwVersion + ')';
mac = device.net_macAddress;
ip = device.net_ipAddress;