Identifying device and hls streaming

Identifying device and hls streaming

Postby blagojco.0712_1 » Sat Jun 14, 2014 2:48 am

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
blagojco.0712_1
 
Posts: 4
Joined: Mon Jul 27, 2015 5:13 am

Identifying device and hls streaming

Postby Support_STA » Sun Jun 15, 2014 6:54 pm

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
Support_STA
 
Posts: 136
Joined: Fri Aug 09, 2013 3:56 am

Identifying device and hls streaming

Postby blagojco.0712_1 » Sat Jun 21, 2014 7:12 am

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
blagojco.0712_1
 
Posts: 4
Joined: Mon Jul 27, 2015 5:13 am

Identifying device and hls streaming

Postby Support_STA » Sun Jun 22, 2014 11:38 pm

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
Support_STA
 
Posts: 136
Joined: Fri Aug 09, 2013 3:56 am

Identifying device and hls streaming

Postby blagojco.0712_1 » Sat Jun 28, 2014 2:07 am

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
blagojco.0712_1
 
Posts: 4
Joined: Mon Jul 27, 2015 5:13 am

Identifying device and hls streaming

Postby dsver_1 » Fri Dec 19, 2014 1:56 am

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 :/
dsver_1
 
Posts: 5
Joined: Mon Jul 27, 2015 12:44 am

Identifying device and hls streaming

Postby dragan.obrenovic_1 » Fri Feb 20, 2015 10:35 am

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;
dragan.obrenovic_1
 
Posts: 2
Joined: Mon Jul 27, 2015 5:05 am


Return to Specification questions



cron