forked from shaka-project/shaka-player
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New autoShowText config to change initial text visibility behav…
…ior (shaka-project#3421) Adds a new autoShowText config to allow apps to choose the behavior of text visibility on startup. The default is the old behavior (`AutoShowText.IF_SUBTITLES_MAY_BE_NEEDED`), which is to auto-enabled text only if we think subtitles may be needed. This is when the user's preferred audio language is unavailable, but the preferred text language **is** available. A new option has been added (`AutoShowText.IF_PREFERRED_TEXT_LANGUAGE`) that will only consider the user's preferred text language. If a match is found, text is visible on startup. Finally, we add two additional options that are extremely simple: `AutoShowText.ALWAYS` and `AutoShowText.NEVER`. Applications that want complete control over text visibility without any "smart" choices made by the player can use these options. Co-authored-by: Joey Parrish <[email protected]>
- Loading branch information
1 parent
749cf6d
commit 5c24410
Showing
11 changed files
with
326 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*! @license | ||
* Shaka Player | ||
* Copyright 2016 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
goog.provide('shaka.config.AutoShowText'); | ||
|
||
/** | ||
* @enum {number} | ||
* @export | ||
*/ | ||
shaka.config.AutoShowText = { | ||
/** Never show text automatically on startup. */ | ||
'NEVER': 0, | ||
/** Always show text automatically on startup. */ | ||
'ALWAYS': 1, | ||
/** | ||
* Show text automatically on startup if it matches the preferred text | ||
* language. | ||
*/ | ||
'IF_PREFERRED_TEXT_LANGUAGE': 2, | ||
/** | ||
* Show text automatically on startup if we think that subtitles may be | ||
* needed. This is specifically if the selected text matches the preferred | ||
* text language AND is different from the initial audio language. (Example: | ||
* You prefer English, but the audio is only available in French, so English | ||
* subtitles should be enabled by default.) | ||
* <br> | ||
* This is the default setting. | ||
*/ | ||
'IF_SUBTITLES_MAY_BE_NEEDED': 3, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.