Hi,
I am working on a video streaming channel application which retrieves video metadata from a web service in JSON format. The retrieved JSON data contain video assets' original upload time in
milliseconds since Epoch. For instance, a video file was uploaded on "02/28/2013 20:41:44" (
1362112904015 Epoch in milliseconds), the retrieved JSON data would look like:
{
"url": "http://www.SomeCDN.com/videos/example.mp4", "upload_time": 1362112904015, ...
}
I used a simple BrightScript code to parse the JSON result:
getVideoRequest = CreateObject("roUrlTransfer")
getVideoRequest.SetURL("http://api.example.com/services/rest/getVideo?file_id=123456")
response = ParseJson(getVideoRequest.GetToString())
The parsed "upload_time" is truncated to
608271183 (04/10/1989 21:13:03) from its original
1362112904015. Obviously, the ParseJson() can't properly handle larger than 4-byte integer values.
Is there a way to instruct ParseJson() function to use DOUBLE's to store numbers that are larger than 4-byte integers? Or, are there better BrightScript JSON parsers out there?
Thanks,
Charles