arabenseifer / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Error in Example: Using the Tracks APIs #468

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Actually not sure if this goes here, but there is some small error in the 
Tracks example here: https://developers.google.com/cast/docs/chrome_sender in 
the section: Using the Tracks APIs. Track dont have a field called contentType 
it is called trackContentType and the variable in the example called track is 
not initialized. Maybe this is pretty obvious, but the solution listed below 
would be better. 

What is the expected output? What do you see instead?
Here is the correct solution:

var englishSubtitle = new chrome.cast.media.Track(1, // track ID
   chrome.cast.media.TrackType.TEXT);
englishSubtitle.trackContentId = 'https://some-url/caption_en.vtt';
englishSubtitle.trackContentType = 'text/vtt';
englishSubtitle.subtype = chrome.cast.media.TextTrackType.SUBTITLES;
englishSubtitle.name = 'English Subtitles';
englishSubtitle.language = 'en-US';
englishSubtitle.customData = null;

var frenchSubtitle = new chrome.cast.media.Track(2, // track ID
   chrome.cast.media.TrackType.TEXT);
frenchSubtitle.trackContentId = 'https://some-url/caption_fr.vtt';
frenchSubtitle.trackContentType = 'text/vtt';
frenchSubtitle.subtype = chrome.cast.media.TextTrackType.SUBTITLES;
frenchSubtitle.name = 'French Subtitles';
frenchSubtitle.language = 'fr';
frenchSubtitle.customData = null;

var frenchAudio = new chrome.cast.media.Track(3, // track ID
   chrome.cast.media.TrackType.AUDIO);
frenchAudio.trackContentId = 'trk0001';
frenchAudio.trackContentType = 'audio/mp3';
frenchAudio.subtype = null;
frenchAudio.name = 'French Audio';
frenchAudio.language = 'fr';
frenchAudio.customData = null;

What version of the product are you using? On what operating system?
Firmwareversion: 22062

Please provide any additional information below.

Original issue reported on code.google.com by mads26330847@gmail.com on 28 Dec 2014 at 8:11

GoogleCodeExporter commented 9 years ago
Thanks for bringing that to our attention, will get that fixed and sorted out 
soon.

Original comment by anad...@google.com on 28 Dec 2014 at 8:18

GoogleCodeExporter commented 9 years ago
Issue has been addressed.

Original comment by anad...@google.com on 30 Dec 2014 at 4:09