ROUNDED_CORNERS not working in google cast sdk

43 Views Asked by At

In my receiver.js I am styling the captions through the TextTrackStyle. I could do most of the things except for the windowType ROUNDED_CORNERS. Nothing happens when I modify the property windowRoundedCornerRadius, I tried from 10 to 1000. Does anybody have a solution?

let textTrackStyle = new cast.framework.messages.TextTrackStyle();
textTrackStyle.fontFamily = "Nunito-Medium";
textTrackStyle.fontScale = 1;
textTrackStyle.backgroundColor = "#000000B3"; // Black with 70% opacity
textTrackStyle.windowType = "ROUNDED_CORNERS";
textTrackStyle.windowRoundedCornerRadius = 10;

playerManager.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE, () => {
  let textTracksManager = playerManager.getTextTracksManager();
  textTracksManager.setTextTrackStyle(textTrackStyle);
});

I am following this documentation: https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.TextTrackStyle

Excepted: Rounded Corners in captions window

Got: Squared Corners

1

There are 1 best solutions below

3
toadv1ne On

The docs show an attribute called windowCornerRadius. You're adding Rounded to the property so it's not actually updating with the correct value.

screenshot of docs