Skip to content

Commit

Permalink
Release/1.4.0 (#149)
Browse files Browse the repository at this point in the history
dawhitla authored Aug 9, 2023
1 parent 76eb278 commit 19efbe7
Showing 22 changed files with 453 additions and 256 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -36,7 +36,7 @@ jobs:
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -57,7 +57,7 @@ jobs:
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache
key: ${{ runner.os }}-setup-cache-2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -76,7 +76,7 @@ jobs:
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
with:
path: |
@@ -113,7 +113,7 @@ jobs:
example/ios/Pods
example/ios/build
example/node_modules
key: ${{ runner.os }}-setup-cache
key: ${{ runner.os }}-setup-cache-2
- uses: actions/cache@v3
with:
path: |
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -66,4 +66,7 @@ test-butler-app.apk

# react-native-config codegen
example/ios/tmp.xcconfig
example/ios/.xcode.env.local
example/ios/.xcode.env.local

# env var
example/.env
Original file line number Diff line number Diff line change
@@ -32,9 +32,9 @@ class AmazonIvsViewManager : SimpleViewManager<AmazonIvsView>() {
Commands.PLAY.ordinal,
"pause",
Commands.PAUSE.ordinal,
"seekTo",
Commands.SET_ORIGIN.ordinal,
"setOrigin",
Commands.SET_ORIGIN.ordinal,
"seekTo",
Commands.SEEK_TO.ordinal,
"togglePip",
Commands.TOGGLE_PIP.ordinal
6 changes: 3 additions & 3 deletions e2e/playgroundPlayer.e2e.js
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ describe('Playground player', () => {
.toBeVisible()
.withTimeout(TIMEOUT);
await element(by.id('settingsIcon')).tap();
await scrollToModalBottom();
await scrollToModalBottom(100);
await element(by.id('muted')).tap();
await element(by.id('closeIcon')).tap();

@@ -134,7 +134,7 @@ describe('Playground player', () => {
.toBeVisible()
.withTimeout(TIMEOUT);
await element(by.id('settingsIcon')).tap();
await scrollToModalBottom();
await scrollToModalBottom(100);
await waitToBeVisibleAndTap(by.id('autoplay'));
await waitToBeVisibleAndTap(by.id('closeIcon'));

@@ -244,7 +244,7 @@ describe('Playground player', () => {
.toBeVisible()
.withTimeout(TIMEOUT);
await element(by.id('settingsIcon')).tap();
await scrollToModalBottom();
await scrollToModalBottom(100);
await element(by.id('progressInterval')).replaceText('1');
await element(by.id('closeIcon')).tap();

2 changes: 1 addition & 1 deletion e2e/playgroundPlayerEvents.e2e.js
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ describe('Playground player events', () => {
);
await element(by.id('closeIcon')).tap();

await atLeastOneLogIsVisible('duration changed: 00:06:02');
await atLeastOneLogIsVisible('duration changed: 00:06:02.36');
});

it('Player notifies about quality change', async () => {
13 changes: 12 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

import org.apache.tools.ant.taskdefs.condition.Os
import com.android.build.OutputFile
import groovy.json.JsonSlurper

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -130,6 +131,16 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

// Create an easy to use function
def getVersionFromNpm() {
// Read and parse package.json file from project root
def inputFile = new File("$rootDir/../package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)

// Return the version, you can get any value this way
return packageJson["version"]
}

android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -144,7 +155,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 16
versionName "1.3.0"
versionName getVersionFromNpm()
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
14 changes: 1 addition & 13 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
const path = require('path');
const pak = require('../package.json');

module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
alias: {
[pak.name]: path.join(__dirname, '..', `${pak.source}.ts`),
},
},
],
],
plugins: [['module:react-native-dotenv']],
};
4 changes: 2 additions & 2 deletions example/ios/AmazonIvsExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -598,7 +598,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = AmazonIvsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -624,7 +624,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = AmazonIvsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
7 changes: 7 additions & 0 deletions example/ios/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@

#import <React/RCTAppSetupUtils.h>

#import <AVFAudio/AVAudioSession.h>

#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
@@ -45,6 +47,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif

// https://stackoverflow.com/a/45430673
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
[audioSession setActive:YES error:nil];

NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"AmazonIvsExample", initProps);

4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- amazon-ivs-react-native-player (1.3.0):
- amazon-ivs-react-native-player (1.4.1):
- AmazonIVSPlayer (~> 1.18.0)
- React-Core
- AmazonIVSPlayer (1.18.0)
@@ -579,7 +579,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
amazon-ivs-react-native-player: f49f58481eb27408c6598797a52b93eeb56e8e97
amazon-ivs-react-native-player: d62a63eecb2d952f3b25a663928d5b5453cd055f
AmazonIVSPlayer: 15b74392987e2385f9a859201273185f76d58959
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
13 changes: 6 additions & 7 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -5,17 +5,14 @@
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"ios": "react-native run-ios --simulator=\"iPhone 14\"",
"start": "react-native start"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/slider": "^4.1.12",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"appcenter": "^4.4.3",
"appcenter-analytics": "^4.4.3",
"appcenter-crashes": "^4.4.3",
"react": "18.0.0",
"react-native": "0.69.9",
"react-native-config": "^1.4.3",
@@ -28,12 +25,14 @@
"react-native-vector-icons": "^9.1.0"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/runtime": "^7.16.7",
"@babel/core": "^7.22.9",
"@babel/runtime": "^7.22.6",
"@types/react-native": "0.66.15",
"@types/react-native-dotenv": "^0.2.0",
"@types/react-native-vector-icons": "^6.4.6",
"babel-plugin-module-resolver": "^4.0.0",
"detox": "^20.1.0",
"metro-react-native-babel-preset": "^0.70.3"
"metro-react-native-babel-preset": "^0.70.3",
"react-native-dotenv": "^3.4.9"
}
}
4 changes: 3 additions & 1 deletion example/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -5,5 +5,7 @@ export const parseSecondsToString = (seconds: number) => {

const date = new Date(0);
date.setSeconds(seconds);
return date.toISOString().slice(11, 19);
date.setMilliseconds(seconds % 1000);

return date.toISOString().slice(11, 22);
};
10 changes: 10 additions & 0 deletions example/src/screens/Home.tsx
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import { Card, Paragraph } from 'react-native-paper';
import { useNavigation } from '@react-navigation/native';
import type { StackNavigationProp } from '@react-navigation/stack';
import { SafeAreaView } from 'react-native-safe-area-context';
// @ts-expect-error these values come from .env file
import { GIT_BRANCH, GIT_COMMIT } from '@env';
import type { RootStackParamList } from '../App';

type HomeScreenNavigationProp = StackNavigationProp<RootStackParamList, 'Home'>;
@@ -59,6 +61,14 @@ function Home() {
</Paragraph>
</Card.Content>
</Card>
<Card testID="Version" style={styles.card}>
<Card.Title title="Version" />
<Card.Content>
<Paragraph>
{GIT_BRANCH} @ {GIT_COMMIT}
</Paragraph>
</Card.Content>
</Card>
</ScrollView>
</SafeAreaView>
);
16 changes: 16 additions & 0 deletions example/src/screens/PlaygroundExample.tsx
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ export default function PlaygroundExample() {
const [autoplay, setAutoplay] = useState(true);
const [paused, setPaused] = useState(false);
const [url, setUrl] = useState(URL);
const [origin, setOrigin] = useState('');
const [muted, setMuted] = useState(false);
const [pauseInBackground, setPauseInBackground] = useState(false);
const [manualQuality, setManualQuality] = useState<Quality | null>(null);
@@ -435,6 +436,21 @@ export default function PlaygroundExample() {
Add
</Button>
</SettingsItem>
<SettingsInputItem
label="origin"
onChangeText={setOrigin}
value={origin}
/>
<SettingsItem label=" ">
<Button
onPress={() => {
mediaPlayerRef.current?.setOrigin(origin);
log(`header origin set to: ${origin}`);
}}
>
setOrigin
</Button>
</SettingsItem>
</View>
</ScrollView>
</View>
Loading

0 comments on commit 19efbe7

Please sign in to comment.