forked from jellyfin-archive/cordova-plugin-chromecast
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
hi, thank you @Lindsay-Needs-Sleep for handling this plugin
I'm just coming to ask if this plugin support subtitle??, trying a lot of tricks to make it work, but still nothing, the subtitle didn't show
my console log for [this.castMedia] :
"tracks":[
{
"trackId"=1,
"type":"VIDEO",
"trackContentType":null,
"trackContentId":"null",
"subtype":'null',
"name":'null',
"language":'null',
"customData":'null'
}
]
code using for
var videoUrl = 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4';
var thesub = 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt';
const englishSubtitle = new chrome.cast.media.Track(1,chrome.cast.media.TrackType.TEXT);
englishSubtitle.trackContentId =thesub ;
englishSubtitle.trackContentType = 'text/vtt';
englishSubtitle.subtype = chrome.cast.media.TextTrackType.SUBTITLES;
englishSubtitle.name = 'English';
englishSubtitle.language = 'en-US';
englishSubtitle.customData = null;
var tracks = [englishSubtitle];
var mediaInfo = new chrome.cast.media.MediaInfo(videoUrl);
/**/ mediaInfo.tracks = tracks;
mediaInfo.activeTrackIds = [1];
this.isCasting = true;
this.castSession.loadMedia(new chrome.cast.media.LoadRequest(mediaInfo), (media:any)=> {
// You should see the video playing now!
// Got media!
this.castMedia = media;
alert(JSON.stringify(this.castMedia, null, 2));
}, function (err) {
// Failed (check that the video works in your browser)
// alert("Failed : check that the video works in your browser")
alert(JSON.stringify(err, null, 2));
this.isCasting = false;
});
Metadata
Metadata
Assignees
Labels
No labels