Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #264 from DolbyIO/release/3.10.1
Browse files Browse the repository at this point in the history
Release/3.10.1
  • Loading branch information
graduad committed Aug 21, 2023
2 parents c96f440 + e03ef1a commit b94e85a
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 52 deletions.
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ MOCKITO_CORE_VERSION=2.26.0
POWERMOCK_VERSION=2.0.2
ROBOLECTRIC_VERSION=4.4
JUNIT_VERSION=4.13.2
COMMS_SDK_VERSION="3.10.0"
COMMS_SDK_VERSION="3.10.1"
COMPONENT_NAME="react-native-sdk"
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ class RNAudioPreviewModule(

/**
* Stops recording or playing an audio sample.
* @param promise returns null
* @param promise returns Boolean.
*/
@ReactMethod
fun stop(promise: ReactPromise) {
Promises.promise({ localAudio.preview().stop() })
.forward(promise, ignoreReturnType = true)
.forward(promise)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions docs/classes/internal.AudioPreview.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ ___

### stop

**stop**(): `Promise`<`void`\>
**stop**(): `Promise`<`boolean`\>

Stops recording or playing an audio sample.

#### Returns

`Promise`<`void`\>
`Promise`<`boolean`\>

___

Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-comms-sdk-example",
"description": "Example app for react-native-dolbyio-sdk",
"version": "3.10.0+1",
"version": "3.10.1+1",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
43 changes: 10 additions & 33 deletions example/src/screens/JoinScreen/JoinScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Space from '@ui/Space';
import Text from '@ui/Text';

import styles from './JoinScreen.style';
import { ConferenceCreateParameters, SpatialAudioStyle } from '@dolbyio/comms-sdk-react-native/models';
import { SpatialAudioStyle } from '@dolbyio/comms-sdk-react-native/models';
import { View } from 'react-native';
import { MenuOptionsButton, type Options } from '@ui/MenuOptionsButton/MenuOptionsButton';
import ExtendedOptions from '@ui/ExtendedOptions';
Expand All @@ -32,17 +32,8 @@ const JoinScreen: FunctionComponent = () => {
const [alias, setAlias] = useState(`${chance.country({ full: true })}`);
const { createAndJoin, replay, listen, getCurrentConference, goToAudioPreviewScreen } = useContext(DolbyIOContext);

const joinConference = () => {
var params: ConferenceCreateParameters = {
dolbyVoice: isDolbyVoice,
liveRecording: isLiveRecording,
spatialAudioStyle: spatialAudioStyle
}
createAndJoin(alias, params);
};

const createConference = async () => {
await createAndJoin(alias, {dolbyVoice: isDolbyVoice, liveRecording: isLiveRecording, spatialAudioStyle: spatialAudioStyle });
await createAndJoin(alias, { dolbyVoice: isDolbyVoice, liveRecording: isLiveRecording, spatialAudioStyle: spatialAudioStyle });
}

const listenConference = () => {
Expand All @@ -69,7 +60,7 @@ const JoinScreen: FunctionComponent = () => {
setLiveRecording(!isLiveRecording);
}

const spatialAudioOptions : Options = [
const spatialAudioOptions: Options = [
{
text: 'Disabled',
value: 'DISABLED',
Expand All @@ -95,7 +86,7 @@ const JoinScreen: FunctionComponent = () => {

const renderSpatialAudioChooser = () => {
if (isDolbyVoice) {
return(
return (
<Space mt='s'>
<MenuOptionsButton options={spatialAudioOptions} >
<View style={styles.menuSpatialAudio}>
Expand All @@ -120,19 +111,8 @@ const JoinScreen: FunctionComponent = () => {
<LinearGradient colors={COLORS.GRADIENT} style={styles.wrapper}>
<SafeAreaView style={styles.wrapper}>
<Space mh="m" mv="s">
<Space mb="l">
<Text color={COLORS.WHITE} header>
Dolby.io
</Text>
<Text color={COLORS.WHITE} size="s">
IAPI SDK for React Native
</Text>
<Text color={COLORS.WHITE} size="xs" header>
TEST APP
</Text>
</Space>
<Text color={COLORS.WHITE} header size="s">
Join Conference
<Text color={COLORS.WHITE} header size="m">
Join or Create the Conference
</Text>
<Space mt="m">
<Input
Expand All @@ -151,13 +131,7 @@ const JoinScreen: FunctionComponent = () => {
</Space>
<Space mt="m">
<Button
text="Join existing conference"
onPress={joinConference}
/>
</Space>
<Space mt="m">
<Button
text="Join to existing conference as listener"
text="Join as listener"
onPress={listenConference}
/>
</Space>
Expand All @@ -168,6 +142,9 @@ const JoinScreen: FunctionComponent = () => {
/>
</Space>
<Space mt="m">
<Text color={COLORS.WHITE} size="xs">
We need this button to test if getCurrent can return null
</Text>
<Button
text="Get current conference"
onPress={getCurrentConference}
Expand Down
4 changes: 2 additions & 2 deletions example/src/utils/audioPreview.testers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const play = async () => {

export const stop = async () => {
try {
await CommsAPI.audio.getLocal().preview().stop();
console.log('Stop success');
const stop = await CommsAPI.audio.getLocal().preview().stop();
console.log('Stop: ', stop.toString());
} catch (e: any) {
console.log(e);
Alert.alert(`Error ${JSON.stringify(e)}`);
Expand Down
6 changes: 2 additions & 4 deletions ios/Services/AudioService/AudioPreviewServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ public class AudioPreviewServiceModule: ReactEmitter {
resolve: @escaping RCTPromiseResolveBlock,
reject: @escaping RCTPromiseRejectBlock
) {
if !VoxeetSDK.shared.audio.local.preview.stop() {
ModuleError.audioPreviewGenericError.send(with: reject)
}
resolve(nil)
let stop = VoxeetSDK.shared.audio.local.preview.stop()
resolve(stop)
}

@objc(release:rejecter:)
Expand Down
2 changes: 1 addition & 1 deletion ios/Services/CommsAPIModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ private enum EventKeys: String, CaseIterable {
}

private let componentName = "react-native-sdk"
private let sdkVersion = "3.10.0"
private let sdkVersion = "3.10.1"

@objc(RNCommsAPIModule)
public class CommsAPIModule: ReactEmitter {
Expand Down
3 changes: 0 additions & 3 deletions ios/Services/Errors/ModuleError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ internal enum ModuleError: Error {
case invalidAudioCaptureModeData([String: Any])
case invalidAudioCaptureStatus
case waitingForSDKImplementation(String)
case audioPreviewGenericError
}

internal extension ModuleError {
Expand Down Expand Up @@ -69,8 +68,6 @@ internal extension ModuleError {
return "invalide AudioCapture status"
case let .waitingForSDKImplementation(version):
return "Waiting for implementation in iOS SDK version: \(version)"
case .audioPreviewGenericError:
return "An AudioPreview error occured."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dolbyio/comms-sdk-react-native",
"version": "3.10.0",
"version": "3.10.1",
"description": "Dolby.io iAPI SDK for React Native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
2 changes: 1 addition & 1 deletion src/services/audio/AudioPreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AudioPreview {
/**
* Stops recording or playing an audio sample.
*/
public async stop(): Promise<void> {
public async stop(): Promise<boolean> {
return this._audioPreview.stop();
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/audio/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('AudioPreview', () => {
describe('stop()', () => {
it('should invoke exported stop method', () => {
CommsAPIAudioPreviewModule.stop.mockImplementation(() =>
Promise.resolve()
Promise.resolve(true)
);
AudioPreview.stop();
expect(CommsAPIAudioPreviewModule.stop).toHaveBeenCalled();
Expand Down

0 comments on commit b94e85a

Please sign in to comment.