Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Added support for player SDK v11. More info on the [migration documentation](./doc/migrating-to-react-native-theoplayer-11.md) page.
- Enabled core library desugaring for Android to support version 3.39.0 of the Google IMA SDK.
- Added `TextTrack.captionChannel` to retrieve the CEA-608 channel and/or CEA-708 service numbers of closed caption text tracks.

### Changed

Expand Down
3 changes: 3 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ android {
minifyEnabled false
}
}
buildFeatures {
buildConfig true
}
lint {
disable 'GradleCompatible'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private const val PROP_NAME = "name"
private const val PROP_ENABLED = "enabled"
private const val PROP_SRC = "src"
private const val PROP_FORCED = "forced"
private const val PROP_CAPTION_CHANNEL = "captionChannel"
private const val PROP_AUDIO_SAMPLING_RATE = "audioSamplingRate"
private const val PROP_BANDWIDTH = "bandwidth"
private const val PROP_QUALITIES = "qualities"
Expand Down Expand Up @@ -69,6 +70,9 @@ object TrackListAdapter {
textTrackPayload.putString(PROP_SRC, textTrack.source)
textTrackPayload.putBoolean(PROP_FORCED, textTrack.isForced)

// THEOplayer v10.13+
textTrack.captionChannel?.let { textTrackPayload.putInt(PROP_CAPTION_CHANNEL, it) }

// Optionally pass cue list.
val cueList = textTrack.cues
if (cueList != null) {
Expand Down
2 changes: 1 addition & 1 deletion e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"peerDependencies": {
"react": "*",
"react-native": "*",
"theoplayer": "^9.12.0 || ^10 || ^11"
"theoplayer": "^11"
},
"peerDependenciesMeta": {
"theoplayer": {
Expand Down
12 changes: 12 additions & 0 deletions src/api/track/TextTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ export interface TextTrack extends Track {
* <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)
*/
readonly forced: boolean;

/**
* The closed caption service number of the text track.
*
* @platform web,android
*
* @remarks
* <br/> - For CEA-608 caption tracks, this holds the channel number.
* <br/> - For CEA-708 caption tracks, this holds the service number.
* <br/> - Otherwise, this is `undefined`.
*/
readonly captionChannel?: number;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/internal/adapter/web/TrackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function fromNativeTextTrackList(tracks: NativeTextTrackList): TextTrack[
}

export function fromNativeTextTrack(track: NativeTextTrack): TextTrack {
const { id, uid, kind, label, language, mode, type, src, forced } = track;
const { id, uid, kind, label, language, mode, type, src, forced, captionChannel } = track;

return {
id,
Expand All @@ -53,6 +53,7 @@ export function fromNativeTextTrack(track: NativeTextTrack): TextTrack {
type,
src,
forced,
captionChannel,
cues: track.cues ? track.cues.map((cue) => fromNativeCue(cue)) : [],
} as TextTrack;
}
Expand Down
Loading