How to turn Subtitles off?

Hi there,
i tried the following to select subtitles and switch them on (or off)

switch (g_sub) {
case "de_sub":
Player.subtitle.visible =true;
Player.track.selectSubtitleTrackNumber(1);
break;
case "fr_sub":
Player.subtitle.visible =true;
Player.track.selectSubtitleTrackNumber(2);
break;
default:
Player.subtitle.visible = false;
break;
}
The first 2 "case" definitions works well. They turn german or french subtitles on. If "g_sub=='off'" the default definition should turn the visibility off. Right Wrong. the last selected subtitle is shown, although g_sub isn't "de_sub" or "fr_sub". How can I turn them off Any ideas

Thanks ds


Answer this question

How to turn Subtitles off?

  • Jimname

    Two things:

    1) Are you using normal subtitles or advanced subtitles

    2) If you read the value of Player.subtitle.visible back after you have set it to false, has it correctly been set to false (I know you don't have the forced attribute set, but this would still help in investigating).



  • Ravel

    Also, are you SURE that the code path is being hit If you put a breakpoint there in the debugger, or if you make some very obvious visual change to the app (like make the background red) does the code ever execute I am wondering if you never hit the default case because your variable is always one of the other two values.

  • Binu Jeesman

    Hi, i checked my code with the debugger (MS Script Editor). The "default" case is executed as expected. Player.subtitle.visible is set to "false". This strange behavior occurs at least with hdisim and the toshiba (qosmio) softwareplayer. At the moment i use a workaround with an emtpy subtitletrack (not very smart, really). BTW, where are the differences between advanced and normal subtitles I use a xas-File for the subtitles. Greetings ds
  • Dawid Weiss

    It probably doesn't make a difference but have you tried this

    case "off":
    Player.subtitle.visible = false;
    break;


  • Marco Otte-Witte

    Hi, the subtitles arn't forced. ds
  • xion.truth

    There are two ways you can do this:

    1. Set Player.subtitle.visible = false in a setMarkupLoadedHandler event.  This method works well in a PlaylistApplication.  I currently use this method.

    2. Create a subtitle track with the track numbered 1 and the language the same as the default language (typically will be "en:00").  The player will automatically select the first "dummy" track.  This is the method that the CES demo used.

     

    As a side note, HDiSim only supports advanced subtitles.


  • S_Parikh

    Advanced subtitles are essentially a title application. It doesn't sound like this is what you are using.

    How are you testing subtitles on HDiSim I didn't think that it supported real subtitle streams.

    It doesn't seem that there is anything wrong with your switch statement - and the fact that the value of Player.subtitle.visible is actually false yet subtitles are being displayed says something else is going on. Can you post the Title tag from your playlist on this title


  • Natan Drozd

    Did you set forced="true" in SubtitleTrack in playlist

  • How to turn Subtitles off?