radiantmediaplayer / rmp-vast

A client-side JavaScript solution to load, parse and display VAST 2, 3 & 4 resources with HTML5 video
https://www.radiantmediaplayer.com/rmp-vast/app/
Other
95 stars 37 forks source link

Add support for ClosedCaptionFiles #65

Open amanmisra3 opened 1 month ago

amanmisra3 commented 1 month ago

There is no method or variable returning from rmpVast having details of subtitle file. Also there is no params value to show/hide the captions in video player

amanmisra3 commented 1 month ago

Tried accessing the captions with the below code

if (rmpVast.adPlayer && rmpVast.closedCaptionFiles) { var tracks = rmpVast.adPlayer.textTracks[0]; console.log(tracks, 'tracks'); tracks.mode = 'showing'; } else { tracks.mode = 'hidden'; }

console.log(rmpVast.adPlayer, 'rmpVast.adPlayer'); ------------->>>> null console.log(rmpVast.closedCaptionFiles, 'rmpVast.closedCaptionFiles); ------------->>>> undefined

radiantmediaplayer commented 1 month ago

Hi, Closed captions for video ads is not currently supported with rmp-vast so there is no method to get/show/hide closed captions that could be present in a VAST 4.1+ response. We can review a PR if you feel like it, to enable support for optional ClosedCaptionFiles node.