Commit c5bae676 authored by liujiaxin's avatar liujiaxin

feat:添加检测用户是否开启音视频权限功能

parent a4e226a0
...@@ -464,7 +464,6 @@ export function RoomPage({ children }: any) { ...@@ -464,7 +464,6 @@ export function RoomPage({ children }: any) {
} }
} }
useEffect(() => { useEffect(() => {
console.log('~~~~~~~~~~~~~~~~')
navigator.permissions.query( navigator.permissions.query(
// { name: 'camera' } // { name: 'camera' }
{ name: 'microphone' } { name: 'microphone' }
...@@ -479,7 +478,8 @@ export function RoomPage({ children }: any) { ...@@ -479,7 +478,8 @@ export function RoomPage({ children }: any) {
permissionStatus.onchange = function(){ permissionStatus.onchange = function(){
checkPerMission(this.state); checkPerMission(this.state);
} }
}) });
navigator.permissions.query( navigator.permissions.query(
{ name: 'camera' } { name: 'camera' }
).then(function(permissionStatus){ ).then(function(permissionStatus){
...@@ -487,7 +487,7 @@ export function RoomPage({ children }: any) { ...@@ -487,7 +487,7 @@ export function RoomPage({ children }: any) {
permissionStatus.onchange = function(){ permissionStatus.onchange = function(){
checkPerMission(this.state); checkPerMission(this.state);
} }
}) });
}, []); }, []);
useEffect(() => { useEffect(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment