-
Notifications
You must be signed in to change notification settings - Fork 51
Add MatroskaJS Chapter Codec #835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
robUx4
wants to merge
2
commits into
ietf-wg-cellar:master
Choose a base branch
from
robUx4:matroskajs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -72,6 +72,84 @@ The one and only command existing for the moment is `GotoAndPlay( ChapterUID );` | |
| same suggests, it means that, when this command is encountered, the `Matroska Player` | ||
| **SHOULD** jump to the `Chapter` specified by the UID and play it, as long as this `Chapter` exists. | ||
|
|
||
| ## MatroskaJS | ||
|
|
||
| This is the case when `ChapProcessCodecID` = 2. This is a script language built for | ||
| Matroska purposes. It uses the [@!ECMAScript] 6th Edition (ES6) syntax. The commands are stored as text commands, in UTF-8. | ||
| The syntax is C like, with commands spanned on many lines, each terminating with a semicolon ";". You can also include comments | ||
| at the end of lines with "//" or comment many lines using "/* \*/". The scripts are stored | ||
| in `ChapProcessData`. For the moment `ChapProcessPrivate` is not used. | ||
|
|
||
| The Matroska Script contains the following commands. | ||
|
|
||
| ### GotoAndPlay | ||
|
|
||
| The command is called with `GotoAndPlay( "<ChapterUID>" );`. | ||
|
|
||
| As the same suggests, it means that, when this command is encountered, the `Matroska Player` | ||
| **SHOULD** jump to the `Chapter` specified by the `ChapterUID` string and play it, as long as this `Chapter` exists. | ||
|
|
||
| ### LogMsg | ||
|
|
||
| The command is called with `LogMsg( "A String" );`. | ||
|
|
||
| The `Matroska Player` **SHOULD** send the provided message to the user debugging console, if there is one. | ||
| In this example it would send "A String", without the double quotes, to the debugging console. | ||
|
|
||
| ### AddChoice | ||
|
|
||
| The command is called with `AddChoice( "<ChoiceUID>", group = Null );`. | ||
|
|
||
| The `Matroska Player` **MUST** keep the choice with the given UID in memory until the Chapter it belongs to | ||
| has ended. The string may be any length and should be a valid ECMAScript string literal. | ||
|
|
||
| If a group string is supplied, the choice **MUST** only be evaluated within the group of the given string. | ||
| Otherwise the choice **MUST** be evaluated with the other choices with no group, called the Default Group. | ||
|
|
||
| It is possible to add a single choice for a group to let the user select it or not, for example with a checkbox. | ||
|
|
||
| ### SetChoiceText | ||
|
|
||
| The command is called with `SetChoiceText( "<ChoiceUID>", "Some text", "<lang>" );`. | ||
|
|
||
| Set the string to use for the choice with the given UID if the given language is selected. | ||
| The language string is the same form defined in [@!RFC5646] as for the `ChapLanguageBCP47` element. | ||
|
|
||
| When the `Matroska Player` collects the strings to use for all available choices, the same language | ||
| rules apply as of [@!Matroska, section 19] for track selection. In addition if a string is missing for a language | ||
| the whole language is considered to be not available, unless there is no other language option available. | ||
|
|
||
| <!-- TODO: allow attaching a choice to a tag, we will need a special tag target for that --> | ||
|
|
||
| ### SetChoiceDefault | ||
|
|
||
| The command is called with `SetChoiceDefault( "<ChoiceUID>", group = Null );`. | ||
|
|
||
| Tell the `Matroska Player` that the choice with the given UID is the default one to use. | ||
| If this function is not called, no choice is considered the default one. | ||
|
|
||
| If a group string is supplied, the default state only applies within the group of the given string. | ||
| Otherwise the default state only applies among the choices of the Default Group. | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a SetChoicePrompt that gives the user context about the choice. Something like SetChoicePrompt("<PromptText>") |
||
| ### CommitChoices | ||
|
|
||
| The command is called with `CommitChoices( );`. | ||
|
|
||
| Tell the `Matroska Player` that all previously added choices with AddChoice ((#addchoice)) should be used. | ||
| This **SHOULD** generate some visually visible choice, with the default choice selected, if there is one. | ||
|
|
||
| ### GetChoice | ||
|
|
||
| The command is called with `GetChoice( group = Null );`. | ||
|
|
||
| The function returns the UID string corresponding to the choice selected by the user. | ||
| If the user did not make a selection and there is no default one, this function returns the ECMAScript `Undefined`. | ||
|
|
||
| If a group string is supplied, the selected UID string returned is the selection within the choices of the given group string. | ||
| Otherwise selected UID string returned is the selection within the choices of the Default Group. | ||
|
|
||
|
|
||
|
|
||
| ## DVD Menu | ||
|
|
||
| This is the case when `ChapProcessCodecID` = 1. Each level of a chapter corresponds | ||
|
|
||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change these to ChapterProcessData, ChapterProcessPrivate, ChapterProcessCodecID to avoid later confusion with things like https://github.com/ietf-wg-cellar/matroska-specification/blob/master/ebml_matroska.xml#L1596