RemoteAudioTrack's native MediaStreamTrack is 'ended' on mute and not going back to 'live' state - agora.io

Here is the demo with mute unmute logic of agora client lib
Main problem is that MediaStreamTrack switching to 'ended' state after setMuted or setEnabled and it is not going back to 'live' state after reverse action on those methods of LocalAudioTrack so I can't use it with AudioContext for audio processing.
Even volume-indicator event on AgoraClient stops firing after mute and unmute actions on LocalAudioTrack
So what is proper way to make mute and unmute and to get actual active native MediaStreamTrack?

You should be able to use the setMuted method which doesn't destroy the track (only stops publishing it) for your use case to continue your processing on the track.
I'm unable to reproduce the the volume-indicator event stopping after mute as you described, I'm attaching a screenshot of the log below.

Related

Expo/React Native : A Continuous Alarm or Sound Notification (like receiving a call ) triggered by remote server

I am using Expo to build an app that will pop up a notification with custom sound and vibration when triggered remotely. The alarm/vibration would play until its dismissed by the user or it times out (say after 1-2 mins) .
Example use case would be when a partner needs my immediate help with baby, they can press a button the app and that would send signal to backend server which would then trigger the notification with alarm on the app at the other end. When the notification is dismissed, an acknowledgement message is sent with Yes or No type message. If the notification times out, then another message is sent like "no response".
Key point to note is that when the app is fully closed, the notification should still be able to pop up.
From my limited understanding , expo notification or push notifications in general cannot achieve this as they don't allow us to create notifications that directly open the app. Even a solution which works like phone or video calling apps (which open when someone calls you ) could work.
Any help would be much appreciated.
Many Thanks!
I looked up expo push notifications but they are limited in terms of customising the notifications.

"unmute-audio" callback of Web RTC is not triggering

I am using RTC for Web. "unmute-audio" callback is not triggering when remote user click on unmute button in mobile app.But it will trigger "stream-added" callback. In mobile I am using below function for mute and unmute stream.Used function for mute and unmute
client.on("stream-subscribed", function(evt){
var stream = evt.stream;
// Mutes the remote stream.
stream.unmuteAudio();
});
try this
"unmute-audio" callback will give userID of remote user who unmuted himself.
As I mentioned in quetion "stream-added" is triggering instead of "unmute-audio". So it is possible to get same userId from "stream-added" callback also. So now I can update mute and unmute status in UI.

Is there any way to intercept reloading event for Android?

When I am running my application on Android device (virtual device) It connects using WebSocket. It's normal flow and there is no question here. When I am using the virtual device for developing I use "Reload" all the time (sure). Can I intercept the reloading process for disconnecting the WS connect? If I do not it manually that my backend won't get relevant event.
You can try to emit the disconnect message in the componentWillUnmount() function. It is bad to use it in a normal app flow (in a back button for example) as it is normally an async function and it is not a good approach to call async functions in the componentWillUnmount(), but in cases that you will only handle the "quit" (reload in your case) I think that this solution can help.

Why don't Chrome and Firefox fire events when a video begins buffering?

The MediaElement.js library for HTML5 video is the most complete option that I have found, and also the only one I can use on this project.
The problem is that when the videos load poorly over a slow connection, neither the video element or the MediaElement library dispatch an event when the video stops playing and begins to buffer. This is only happening in Chrome and Firefox.
I have added event listeners to the stalled, waiting, and suspended events, and none of them are fired when the video pauses to buffer in Chrome or Firefox.
Any ideas? Any help is greatly appreciated.
Thanks!
If you look at the code for MediaElement.js, you'll notice the stalled and suspended are not set for MediaElement object. Waiting wouldn't work because it's called when the playback is waiting on another operation (e.g. seek)
waiting: Sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek). https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
This is not tested, but you can try the following
Set a playing event that will create an interval to check the current
time of the video. If the video current time didn't change from last interval, than
most likely the video is buffering or not loading.
Set a pause event to clear the interval.
You might need to set other events to make sure the event
is not triggered by user actions.
Hope this helps.

Sencha Locationupdate event working even if gps is turned off

I am using Ext.util.Geolocation library in Senchatouch.There are two listeners namely locationupdate which fires when the users co-ordinates are obtained and locationerror which is fired when there is a error in fetching the user co-ordinates. Now even when I turn the gps off on my android device the locationupdate event is fired.I would like to know if the locationupdate listener is a measure to check if the gps is active or not or I need to try a different way.Experts Please suggest.
You might want to check carefully your device location settings, this would happen to me on Android if I switch off the geolocation service but leave the google wifi location active.. hth.