Skip to content

Commit ae32ad8

Browse files
committed
feat(example): set frame rate
1 parent 7414ba7 commit ae32ad8

File tree

1 file changed

+4
-2
lines changed
  • packages/RNWebRTCARExample/js/utils

1 file changed

+4
-2
lines changed

Diff for: packages/RNWebRTCARExample/js/utils/rtc.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
import config from '../config'
1313
import { createSignalClient } from './signal'
1414

15+
const fps = 30
16+
1517
async function getLocalStream(isFront, ar) {
1618
const sourceInfos = await mediaDevices.enumerateDevices()
1719
let videoSourceId
@@ -29,7 +31,7 @@ async function getLocalStream(isFront, ar) {
2931
mandatory: {
3032
// minWidth: 500,
3133
// minHeight: 300,
32-
minFrameRate: 30,
34+
minFrameRate: fps,
3335
},
3436
facingMode: isFront ? 'user' : 'environment',
3537
optional: videoSourceId ? [{ sourceId: videoSourceId }] : [],
@@ -157,7 +159,7 @@ export const createWebRTCClient = ({
157159
localStream = stream
158160
onLocalStream(stream)
159161
if (ar) {
160-
startCapturingARView().then(result =>
162+
startCapturingARView({ frameRate: fps }).then(result =>
161163
onLog('Start WebRTC AR session', result),
162164
)
163165
}

0 commit comments

Comments
 (0)