Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/implement…
Browse files Browse the repository at this point in the history
…-codegen-types
  • Loading branch information
yungblud committed Mar 6, 2024
2 parents 941dab4 + ba00881 commit 859cfa3
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/pages/component/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This page shows the list of available properties to configure player
| [selectedAudioTrack](#selectedaudiotrack) | Android, iOS, visionOS |
| [selectedTextTrack](#selectedtexttrack) | Android, iOS visionOS |
| [selectedVideoTrack](#selectedvideotrack) | Android |
| [shutterColor](#shutterColor) | Android |
| [shutterColor](#shuttercolor) | Android |
| [source](#source) | All |
| [subtitleStyle](#subtitlestyle) | Android |
| [textTracks](#texttracks) | Android, iOS, visionOS |
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/other/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"caching": "Caching",
"misc": "Misc",
"debug": "Debugging"
"debug": "Debugging",
"new-arch": "New Architecture"
}
25 changes: 25 additions & 0 deletions docs/pages/other/new-arch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# New Architecture

## Fabric
Library currently does not support Fabric. We are working on it. In the meantime, you can use Interop Layer.

## Interop Layer
You can use this library on New Architecture by using Interop Layer. <br/> To use Interop Layer you need to have `react-native` >= `0.72.0` & `react-native-video` >= `6.0.0-beta.5`.

For `react-native` < `0.74` you need to add config in `react-native.config.js` file.

```javascript
module.exports = {
project: {
android: {
unstable_reactLegacyComponentNames: ['Video'],
},
ios: {
unstable_reactLegacyComponentNames: ['Video'],
},
},
};
```

## Bridgeless Mode
Library currently does not support Bridgeless Mode. We are working on it.
4 changes: 4 additions & 0 deletions examples/basic/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const config = {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
nodeModulesPaths: [
path.resolve(path.join(__dirname, './node_modules')),
path.resolve(path.join(__dirname, '../../node_modules'))
],
transformer: {
getTransformOptions: async () => ({
transform: {
Expand Down
27 changes: 18 additions & 9 deletions ios/Video/Features/RCTVideoUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,23 +299,32 @@ enum RCTVideoUtils {
if let textTracks {
for i in 0 ..< tracks.count {
guard let track = tracks[i]?.first else { continue } // fix when there's no textTrackAsset
validTextTracks.append(textTracks[i])

let textCompTrack: AVMutableCompositionTrack! = mixComposition.addMutableTrack(withMediaType: AVMediaType.text,
preferredTrackID: kCMPersistentTrackID_Invalid)
try? textCompTrack.insertTimeRange(
CMTimeRangeMake(start: .zero, duration: videoAsset.timeRange.duration),
of: track,
at: .zero
)

do {
try textCompTrack.insertTimeRange(
CMTimeRangeMake(start: .zero, duration: videoAsset.timeRange.duration),
of: track,
at: .zero
)
validTextTracks.append(textTracks[i])
} catch {
// TODO: upgrade error by call some props callback to better inform user
print("Error occurred on textTrack insert attempt: \(error.localizedDescription)")
continue
}
}
}

return
}.then {
let emptyVttFile: TextTrack? = self.createEmptyVttFile()
if emptyVttFile != nil {
validTextTracks.append(emptyVttFile!)
if !validTextTracks.isEmpty {
let emptyVttFile: TextTrack? = self.createEmptyVttFile()
if emptyVttFile != nil {
validTextTracks.append(emptyVttFile!)
}
}

fulfill(validTextTracks)
Expand Down
1 change: 1 addition & 0 deletions src/types/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export interface ReactVideoProps extends ReactVideoEvents, ViewProps {
selectedTextTrack?: SelectedTrack;
selectedVideoTrack?: SelectedVideoTrack; // android
subtitleStyle?: SubtitleStyle; // android
shutterColor?: string; // Android
textTracks?: TextTracks;
testID?: string;
trackId?: string; // Android
Expand Down

0 comments on commit 859cfa3

Please sign in to comment.