react-native-spalla-player 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,7 @@ const playerRef = React.useRef<SpallaPlayer | null>(null);
41
41
 
42
42
  const [muted, setMuted] = React.useState(false);
43
43
  const [playing, setPlaying] = React.useState(true);
44
+ const [subtitle, setSubtitle] = React.useState<String | null>('pt-br');
44
45
 
45
46
  <SafeAreaView style={styles.container}>
46
47
  <SpallaPlayer
@@ -49,6 +50,7 @@ const [playing, setPlaying] = React.useState(true);
49
50
  contentId="Spalla contentId"
50
51
  muted={muted}
51
52
  hideUI={false}
53
+ subtitle={subtitle}
52
54
  onPlayerEvent={({ nativeEvent }) => {
53
55
  switch (nativeEvent.event) {
54
56
  case 'timeUpdate':
@@ -70,6 +72,13 @@ const [playing, setPlaying] = React.useState(true);
70
72
  case 'unmuted':
71
73
  setMuted(false);
72
74
  break;
75
+ case 'subtitleSelected':
76
+ console.log('subtitleSelected', nativeEvent.subtitle);
77
+ setSubtitle(nativeEvent.subtitle);
78
+ break;
79
+ case 'subtitlesAvailable':
80
+ console.log('subtitlesAvailable', nativeEvent.subtitles);
81
+ break;
73
82
  default:
74
83
  console.log('event', nativeEvent.event);
75
84
  }
@@ -103,6 +112,7 @@ const [playing, setPlaying] = React.useState(true);
103
112
  | **`muted`** | boolean | mute/unmute video
104
113
  | **`startTime`** | number | time to start the video in seconds (defaults to 0 = start of the video)
105
114
  | **`onPlayerEvent`**| callback | Function that will be called with player events
115
+ | **`subtitle`** | string | subtitle to enable. Null will hide subtitles
106
116
 
107
117
  ## Imperative Methods
108
118
 
@@ -104,7 +104,7 @@ dependencies {
104
104
  implementation "com.facebook.react:react-native:+"
105
105
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
106
106
  implementation "androidx.mediarouter:mediarouter:1.2.0"
107
- implementation "stream.spalla:spalla-android-sdk:1.6.0"
107
+ implementation "stream.spalla:spalla-android-sdk:1.6.1"
108
108
  implementation "com.google.android.gms:play-services-cast-framework:21.3.0"
109
109
  }
110
110
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-spalla-player",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Spalla SDK for RN",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
 
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
- s.dependency "SpallaSDK", "~> 0.9.0"
19
+ s.dependency "SpallaSDK", "~> 0.9.1"
20
20
 
21
21
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
22
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.