Skip to content

is it support subtitles ? #14

@megasto

Description

@megasto

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions