@daily-co/react-native-daily-js 0.24.0 → 0.27.0

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
@@ -15,7 +15,7 @@ Install `react-native-daily-js` along with its peer dependencies:
15
15
 
16
16
  ```bash
17
17
  npm i @daily-co/react-native-daily-js @react-native-async-storage/async-storage@^1.15.7 react-native-background-timer@^2.3.1
18
- npm i --save-exact @daily-co/react-native-webrtc@1.94.1-daily.2
18
+ npm i --save-exact @daily-co/react-native-webrtc@1.94.1-daily.4
19
19
  ```
20
20
 
21
21
  Then, follow the below steps to set up your native project on each platform. **Note that these steps assume you're using a version of React Native that supports autolinking (>= 60).**
@@ -1,26 +1,13 @@
1
- // android/build.gradle
2
-
3
- // based on:
4
- //
5
- // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
6
- // original location:
7
- // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
8
- //
9
- // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
10
- // original location:
11
- // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
12
-
13
- def DEFAULT_COMPILE_SDK_VERSION = 28
14
- def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
15
- def DEFAULT_MIN_SDK_VERSION = 16
16
- def DEFAULT_TARGET_SDK_VERSION = 28
1
+ def DEFAULT_COMPILE_SDK_VERSION = 31
2
+ def DEFAULT_BUILD_TOOLS_VERSION = '31.0.0'
3
+ def DEFAULT_MIN_SDK_VERSION = 24
4
+ def DEFAULT_TARGET_SDK_VERSION = 31
17
5
 
18
6
  def safeExtGet(prop, fallback) {
19
7
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20
8
  }
21
9
 
22
10
  apply plugin: 'com.android.library'
23
- apply plugin: 'maven'
24
11
 
25
12
  buildscript {
26
13
  // The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -33,14 +20,11 @@ buildscript {
33
20
  mavenCentral()
34
21
  }
35
22
  dependencies {
36
- classpath 'com.android.tools.build:gradle:3.4.1'
23
+ classpath 'com.android.tools.build:gradle:3.4.3'
37
24
  }
38
25
  }
39
26
  }
40
27
 
41
- apply plugin: 'com.android.library'
42
- apply plugin: 'maven'
43
-
44
28
  android {
45
29
  compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
46
30
  buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
@@ -78,87 +62,3 @@ dependencies {
78
62
  //noinspection GradleDynamicVersion
79
63
  implementation 'com.facebook.react:react-native:+' // From node_modules
80
64
  }
81
-
82
- def configureReactNativePom(def pom) {
83
- def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
84
-
85
- pom.project {
86
- name packageJson.title
87
- artifactId packageJson.name
88
- version = packageJson.version
89
- group = "com.reactlibrary"
90
- description packageJson.description
91
- url packageJson.repository.baseUrl
92
-
93
- licenses {
94
- license {
95
- name packageJson.license
96
- url packageJson.repository.baseUrl + '/blob/main/' + packageJson.licenseFilename
97
- distribution 'repo'
98
- }
99
- }
100
-
101
- developers {
102
- developer {
103
- id packageJson.author.username
104
- name packageJson.author.name
105
- }
106
- }
107
- }
108
- }
109
-
110
- afterEvaluate { project ->
111
- // some Gradle build hooks ref:
112
- // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
113
- task androidJavadoc(type: Javadoc) {
114
- source = android.sourceSets.main.java.srcDirs
115
- classpath += files(android.bootClasspath)
116
- classpath += files(project.getConfigurations().getByName('compile').asList())
117
- include '**/*.java'
118
- }
119
-
120
- task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
121
- classifier = 'javadoc'
122
- from androidJavadoc.destinationDir
123
- }
124
-
125
- task androidSourcesJar(type: Jar) {
126
- classifier = 'sources'
127
- from android.sourceSets.main.java.srcDirs
128
- include '**/*.java'
129
- }
130
-
131
- android.libraryVariants.all { variant ->
132
- def name = variant.name.capitalize()
133
- def javaCompileTask = variant.javaCompileProvider.get()
134
-
135
- task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
136
- from javaCompileTask.destinationDir
137
- }
138
- }
139
-
140
- artifacts {
141
- archives androidSourcesJar
142
- archives androidJavadocJar
143
- }
144
-
145
- // Disable Maven deploy for now (only support Gradle builds).
146
- //
147
- // When this is enabled, configureReactNativePom and/or package.json will
148
- // have to be updated so they align to configure a valid POM (not sure what
149
- // fields are required or how to test this yet).
150
- //
151
- // Current misalignment:
152
- // - license
153
- // - author.username
154
- // - the fact of requiring a sole author (we'll want multiple contributors)
155
- //
156
- // task installArchives(type: Upload) {
157
- // configuration = configurations.archives
158
- // repositories.mavenDeployer {
159
- // // Deploy to react-native-event-bridge/maven, ready to publish to npm
160
- // repository url: "file://${projectDir}/../android/maven"
161
- // configureReactNativePom pom
162
- // }
163
- // }
164
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "version": "0.24.0",
3
+ "version": "0.27.0",
4
4
  "description": "React Native library for making video calls using Daily",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
27
27
  },
28
28
  "dependencies": {
29
- "@daily-co/daily-js": "^0.26.0",
29
+ "@daily-co/daily-js": "^0.29.0",
30
30
  "@types/react-native-background-timer": "^2.0.0",
31
31
  "react-native-url-polyfill": "^1.1.2"
32
32
  },
@@ -53,6 +53,9 @@ export type DailyEvent =
53
53
  | 'recording-stopped'
54
54
  | 'recording-stats'
55
55
  | 'recording-error'
56
+ | 'transcription-started'
57
+ | 'transcription-stopped'
58
+ | 'transcription-error'
56
59
  | 'app-message'
57
60
  | 'active-speaker-change'
58
61
  | 'network-quality-change'
@@ -120,8 +123,17 @@ export interface DailyLoadOptions extends DailyCallOptions {
120
123
  baseUrl?: string;
121
124
  }
122
125
 
126
+ export interface CamSimulcastEncoding {
127
+ maxBitrate: number;
128
+ maxFramerate?: number;
129
+ scaleResolutionDownBy?: number;
130
+ }
131
+
123
132
  export interface DailyAdvancedConfig {
133
+ camSimulcastEncodings?: CamSimulcastEncoding[];
124
134
  experimentalGetUserMediaConstraintsModify?: (constraints: any) => void;
135
+ micAudioMode?: 'music' | 'speech';
136
+ userMediaAudioConstraints?: boolean | MediaTrackConstraints;
125
137
  userMediaVideoConstraints?: boolean | MediaTrackConstraints;
126
138
  preferH264ForCam?: boolean;
127
139
  h264Profile?: string;
@@ -481,6 +493,18 @@ export interface DailyEventObjectLiveStreamingStarted {
481
493
  layout?: DailyStreamingLayoutConfig;
482
494
  }
483
495
 
496
+ export interface DailyEventObjectTranscriptionStarted {
497
+ action: Extract<DailyEvent, 'transcription-started'>;
498
+ language: string;
499
+ model: string;
500
+ startedBy: string;
501
+ }
502
+
503
+ export interface DailyEventObjectTranscriptionStopped {
504
+ action: Extract<DailyEvent, 'transcription-stopped'>;
505
+ updatedBy: string;
506
+ }
507
+
484
508
  export interface DailyEventObjectRemoteMediaPlayerUpdate {
485
509
  action: Extract<
486
510
  DailyEvent,
@@ -571,11 +595,23 @@ export interface DailyStreamingPortraitLayoutConfig {
571
595
  max_cam_streams?: number;
572
596
  }
573
597
 
598
+ export interface DailyStreamingCustomLayoutConfig {
599
+ preset: 'custom';
600
+ composition_id: string;
601
+ composition_params?: {
602
+ [key: string]: boolean | number | string;
603
+ };
604
+ session_assets?: {
605
+ [key: string]: string;
606
+ };
607
+ }
608
+
574
609
  export type DailyStreamingLayoutConfig =
575
610
  | DailyStreamingDefaultLayoutConfig
576
611
  | DailyStreamingSingleParticipantLayoutConfig
577
612
  | DailyStreamingActiveParticipantLayoutConfig
578
- | DailyStreamingPortraitLayoutConfig;
613
+ | DailyStreamingPortraitLayoutConfig
614
+ | DailyStreamingCustomLayoutConfig;
579
615
 
580
616
  export type DailyRemoteMediaPlayerSettingPlay = 'play';
581
617
  export type DailyRemoteMediaPlayerSettingPause = 'pause';
@@ -608,12 +644,18 @@ export type DailyAccessRequest = {
608
644
  export interface DailyStreamingOptions {
609
645
  width?: number;
610
646
  height?: number;
647
+ fps?: number;
611
648
  backgroundColor?: string;
612
649
  layout?: DailyStreamingLayoutConfig;
613
650
  }
614
651
 
652
+ export interface DailyStreamingEndpoint {
653
+ endpoint: string;
654
+ }
655
+
615
656
  export interface DailyLiveStreamingOptions extends DailyStreamingOptions {
616
- rtmpUrl: string;
657
+ rtmpUrl?: string | string[];
658
+ endpoints?: DailyStreamingEndpoint[];
617
659
  }
618
660
 
619
661
  export interface RemoteMediaPlayerSimulcastEncoding {
@@ -650,6 +692,11 @@ export interface DailyRemoteMediaPlayerInfo {
650
692
  remoteMediaPlayerState: DailyRemoteMediaPlayerState;
651
693
  }
652
694
 
695
+ export interface DailyTranscriptionDeepgramOptions {
696
+ language?: string;
697
+ model?: string;
698
+ }
699
+
653
700
  export interface DailyCall {
654
701
  join(properties?: DailyCallOptions): Promise<DailyParticipantsObject | void>;
655
702
  leave(): Promise<void>;
@@ -705,6 +752,12 @@ export interface DailyCall {
705
752
  getInputDevices(): Promise<DailyDeviceInfos>;
706
753
  startLiveStreaming(options: DailyLiveStreamingOptions): void;
707
754
  updateLiveStreaming(options: { layout?: DailyStreamingLayoutConfig }): void;
755
+ addLiveStreamingEndpoints(options: {
756
+ endpoints: DailyStreamingEndpoint[];
757
+ }): void;
758
+ removeLiveStreamingEndpoints(options: {
759
+ endpoints: DailyStreamingEndpoint[];
760
+ }): void;
708
761
  stopLiveStreaming(): void;
709
762
  startRemoteMediaPlayer(
710
763
  options: DailyRemoteMediaPlayerStartOptions
@@ -713,6 +766,8 @@ export interface DailyCall {
713
766
  updateRemoteMediaPlayer(
714
767
  options: DailyRemoteMediaPlayerUpdateOptions
715
768
  ): Promise<DailyRemoteMediaPlayerInfo>;
769
+ startTranscription(options?: DailyTranscriptionDeepgramOptions): void;
770
+ stopTranscription(): void;
716
771
  preAuth(properties?: DailyCallOptions): Promise<{ access: DailyAccess }>;
717
772
  load(properties?: DailyLoadOptions): Promise<void>;
718
773
  startRecording(options?: DailyStreamingOptions): void;