Skip to content

Commit c3e10c8

Browse files
feat: add demo to stream to a RTMP link
1 parent 9c72045 commit c3e10c8

File tree

269 files changed

+17818
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+17818
-0
lines changed

demo/StreamRtmp/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

demo/StreamRtmp/.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
API_URL=
2+
APP_ENV=development
3+
CODEPUSH_KEY_IOS=
4+
CODEPUSH_KEY_ANDROID=
5+
APP_ID=com.saigontechnology.streamrtmp.development
6+
APP_NAME=BaseDev
7+
PROJECT_NAME=StreamRtmp
8+
9+
#Config for codepush and build
10+
APPCENTER_TOKEN_ANDROID=
11+
APPCENTER_TOKEN_IOS=
12+
APPCENTER_APP_NAME_ANDROID=
13+
APPCENTER_APP_NAME_IOS=
14+
APPCENTER_APP_DISPLAY_NAME=
15+
APPCENTER_RELEASE_NOTE=
16+
APPCENTER_DISTRIBUTE_DESTINATIONS=Public
17+
APPLE_TEAM_ID=

demo/StreamRtmp/.env.development

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
API_URL=
2+
APP_ENV=development
3+
CODEPUSH_KEY_IOS=
4+
CODEPUSH_KEY_ANDROID=
5+
APP_ID=com.saigontechnology.streamrtmp.development
6+
APP_NAME=BaseDevelopment
7+
PROJECT_NAME=StreamRtmp
8+
9+
#Config for codepush and build
10+
APPCENTER_TOKEN_ANDROID=
11+
APPCENTER_TOKEN_IOS=
12+
APPCENTER_APP_NAME_ANDROID=
13+
APPCENTER_APP_NAME_IOS=
14+
APPCENTER_APP_DISPLAY_NAME=
15+
APPCENTER_RELEASE_NOTE=
16+
APPCENTER_DISTRIBUTE_DESTINATIONS=Public
17+
APPLE_TEAM_ID=

demo/StreamRtmp/.env.production

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
API_URL=
2+
APP_ENV=production
3+
CODEPUSH_KEY_IOS=
4+
CODEPUSH_KEY_ANDROID=
5+
APP_ID=com.saigontechnology.streamrtmp
6+
APP_NAME=Base
7+
8+
#Config for codepush and build
9+
APPCENTER_TOKEN_ANDROID=
10+
APPCENTER_TOKEN_IOS=
11+
APPCENTER_APP_NAME_ANDROID=
12+
APPCENTER_APP_NAME_IOS=
13+
APPCENTER_APP_DISPLAY_NAME=
14+
APPCENTER_RELEASE_NOTE=
15+
APPCENTER_DISTRIBUTE_DESTINATIONS=Public
16+
APPLE_TEAM_ID=

demo/StreamRtmp/.env.staging

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
API_URL=
2+
APP_ENV=staging
3+
CODEPUSH_KEY_IOS=
4+
CODEPUSH_KEY_ANDROID=
5+
APP_ID=com.saigontechnology.streamrtmp.staging
6+
APP_NAME=BaseStaging
7+
8+
#Config for codepush and build
9+
APPCENTER_TOKEN_ANDROID=
10+
APPCENTER_TOKEN_IOS=
11+
APPCENTER_APP_NAME_ANDROID=
12+
APPCENTER_APP_NAME_IOS=
13+
APPCENTER_APP_DISPLAY_NAME=
14+
APPCENTER_RELEASE_NOTE=
15+
APPCENTER_DISTRIBUTE_DESTINATIONS=Public
16+
APPLE_TEAM_ID=

demo/StreamRtmp/.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'@react-native',
5+
'eslint:recommended',
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
'plugin:@typescript-eslint/eslint-recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
],
11+
parser: '@typescript-eslint/parser',
12+
plugins: ['@typescript-eslint', 'import', 'unused-imports'],
13+
overrides: [
14+
{
15+
files: ['*.ts', '*.tsx', '*.js'],
16+
rules: {
17+
semi: 'off',
18+
'comma-dangle': 'off',
19+
'no-shadow': 'off',
20+
'no-undef': 'off',
21+
'import/no-cycle': 'warn',
22+
'import/first': 'error',
23+
'import/no-duplicates': 'error',
24+
'unused-imports/no-unused-imports': 'error',
25+
'arrow-body-style': ['error', 'as-needed'],
26+
'@typescript-eslint/no-shadow': ['error'],
27+
'@typescript-eslint/no-empty-interface': 'warn',
28+
},
29+
},
30+
],
31+
}

demo/StreamRtmp/.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn pretty && yarn lint:fix

demo/StreamRtmp/.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
semi: false,
8+
printWidth: 110,
9+
}

demo/StreamRtmp/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

demo/StreamRtmp/App.tsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import React, {useEffect} from 'react'
2+
import {LogBox, PermissionsAndroid, Text} from 'react-native'
3+
import {SafeAreaProvider} from 'react-native-safe-area-context'
4+
import {Provider} from 'react-redux'
5+
import {configureLocalization} from './src/locale/I18nConfig'
6+
import MainLayout from './src/MainLayout'
7+
import {injectStore} from './src/services/networking/axios'
8+
import {store, persistor} from './src/store/store'
9+
import {PersistGate} from 'redux-persist/integration/react'
10+
11+
interface TextWithDefaultProps extends Text {
12+
defaultProps?: {
13+
allowFontScaling?: boolean
14+
underlineColorAndroid?: 'transparent'
15+
}
16+
}
17+
/* eslint-disable @typescript-eslint/no-extra-semi */
18+
;(Text as unknown as TextWithDefaultProps).defaultProps = {
19+
...(Text as unknown as TextWithDefaultProps).defaultProps,
20+
allowFontScaling: false,
21+
underlineColorAndroid: 'transparent',
22+
}
23+
LogBox.ignoreAllLogs(true)
24+
25+
injectStore(store)
26+
configureLocalization('en')
27+
28+
/**
29+
* @name requestCameraAndAudioPermission
30+
* @description Function to request permission for Audio and Camera
31+
*/
32+
const requestCameraAndAudioPermission = async () => {
33+
try {
34+
const granted = await PermissionsAndroid.requestMultiple([
35+
PermissionsAndroid.PERMISSIONS.CAMERA,
36+
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
37+
])
38+
if (
39+
granted['android.permission.RECORD_AUDIO'] === PermissionsAndroid.RESULTS.GRANTED &&
40+
granted['android.permission.CAMERA'] === PermissionsAndroid.RESULTS.GRANTED
41+
) {
42+
console.log('You can use the cameras & mic')
43+
} else {
44+
console.log('Permission denied')
45+
}
46+
} catch (err) {
47+
console.warn(err)
48+
}
49+
}
50+
51+
function App(): React.JSX.Element {
52+
useEffect(() => {
53+
requestCameraAndAudioPermission()
54+
}, [])
55+
56+
return (
57+
<Provider store={store}>
58+
<PersistGate loading={null} persistor={persistor}>
59+
<SafeAreaProvider>
60+
<MainLayout />
61+
</SafeAreaProvider>
62+
</PersistGate>
63+
</Provider>
64+
)
65+
}
66+
67+
export default App

0 commit comments

Comments
 (0)