React twiliio programmable video switch camera is not working - reactjs

I use "twilio-video": "^2.8.0" for building a video chat app. On mobile devices chat app should be able to switch the camera front and back.
I try something like this to the video track
tracks.restart({ facingMode: 'environment' })
But If I console log the tracks. There is no method called restart. Why would this happen?
Any help!
Thanks in adcanced. =)

Twilio developer evangelist here.
Can you upgrade to 2.9.0? I just tested with 2.8.0 and it didn't work, but 2.9.0 had the restart function.

Related

React Native live steam and camera filtering

We have an app developed by react-native we already use
react-native-nodemediaclient for streaming and working fine but now we need to put a filter like the Instagram filter on the camera as far as I search that package does not support these things.
Now my question is any solution for handling this?
Thanks for help!

How to embed a website in expo React Native

I want to embed or just redirect to a website I made which uses a webcam. I can redirect to the website with webView however the camera doesn't work.
This is the website I want to embed. https://chinmaymhatre.github.io/currency_detector
I don't think you can permit camera access inside a webview in a react native or expo app because of security concerns, neither could I find anything like that.
I think it would be easier to just implement this right into the react native app(if the app you want to show in the webview is written in javascript)
I have tried something similar. So, sometime ago I was making a video streaming app using React Native for a website that I made using WebRTC which was using camera and other medias(Video, Audio and Screen). I tried to be smart and tried to embed the webpage directly into the React Native App. My Idea was that I could access the Camera and other user media in Mobile Browser So, it should work with React Native as well. But this is not how the react-native works, React Native doesn't uses iframe to work or in other words react-native develops Native Apps for both IOS and Android. You can always implement an iframe in expo, but this is against the Device Security to provide such level of access to user-media. The device doesn't allow such functionality via iframe (here's the link to a live example how to implement iframe in expo). So, to understand it better You should use react-native-cli to make a simple app not expo. Now for using camera in expo there's a package called expo-camera (here's link) Which helps you develop camera oriented apps using Expo. If this doesn't answer your questions then let me know. Happy Coding :)

Is there any way to stream music in the background with Ionic framework?

I'm developing an Android app using Ionic for music streaming, like a personal Spotify. I can easily play an audio file using Streaming Media plugin, but it seems that this plugin was made for video purposes, because it always brings the player to the front in fullscreen, so you can't navigate through the app while the music is playing, you also can't lock your screen or the playback is stopped.
Is there any way to stream music in the background? Like when I tap the song I want to play, it just starts playing without bringing in another screen? (like you can easily do in AndroidStudio with MediaPlayer). I've search it anywhere for the past week and I just can't find any solution.
I realized Background-Audio in my ionic2/3 Project with
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-music-controls 2.1.4 "MusicControls"
and to workaround some issues on ios I need to add this plugin also
nl.kingsquare.cordova.background-audio 1.0.1 "background-audio"

How to open phone camera in reactjs

I am using 'react-webcam' component in my application. For web it is working for me but in mobile device it is not working. And My client needs that he immediately get to the phone's camera if he click take camera button in mobile device. please anyone help me to fix this issue
Thanks
There is an rpm package which can be used to open the camera. I have not used this yet.
Just try yourself.
npm package
Thanks
As mentioned here, Your service should be served secure, either from localhost or an https connection.
AND in ios>=11 Apple restricts WebRTC to Safari only!

Getting native ringtones in ionic app?

I am developing a ionic app which has functionality to set reminder in app. After one button click i want to open up list which contains native ringtones of msg for both android and ios. How can i get these sounds in a list and then play it in my local notification of reminder. Thanx in advance
You can look into Cordova plugins that will provide you an interface to load up the system ringtones.
A Cordova / Phonegap ringtone plugin for Android. Set an audio file as ringtone, notification tone or alarm tone.
This could be helpful : https://github.com/Hiraqui/cordova-plugin-ringtone

Resources