Publishing App Not Triggering OnSteamReceived Event - android

I have two Android devices running separate TokBox apps which are trying to communicate with each other through video chat. I am having a problem in getting the OnStreamReceived event from one of my application which is publishing the video chat. But the application that subscribes the video triggers the event. I need the event to be triggered on the publishing side. Can anybody let me know the reason? Thanks.

Tokbox QA staff here.
Not sure what you mean with "separate Tokbox apps", but, if you use the same API Key for both ends, and you connect to the same session, the OnStreamReceived event would be received by the subscribers, not the publisher. This event will be triggered when another client publishes a stream, which means that the subscriber will not trigger the event. You can find further information here:
https://tokbox.com/developer/guides/subscribe-stream/android/#detect_streams

TokBox Developer Evangelist here.
As Fran mentioned, the onStreamReceived will only fire when another client in the session publishes. If you want to know when the publisher has started to publish from the publisher's perspective, please use this method:
public void onStreamCreated(PublisherKit publisherKit, Stream stream) {
// publishing - do something
}

About half the time the Publisher.StreamCreated event doesn't fire. The breakpoint simply isn't hit and the subscribers are therefore not notified since the publisher isn't sending anything. It's really hit or miss and frustrating.

Related

Web RTC - One to One call,no error but, no remote video streaming

Am using Kurento Media server for the one to one call.
In browser the call happens with no issues.
But I want to implement this in android.
Am using this, https://github.com/MaxMaes/WebRTCTest
Since, it is stated, the project is not complete, Am trying to complete this.
Am following all the steps of WebRTC.
Am able to connect to kurento one-one call app, running in server. The flow goes like this
Party A created in browser.
Party B created in android app.
A makes a call to B.
Now, on receiving "incoming call" message, the call is accepted.
pc.createOffer is called.
onCreateSuccess, pc.setLocalDescription is done. sdpoffer is sent to B.
parallelly, receiving "onIceCandidate", pc.addIceCanditate is done.
ICEGatheringState = Complete
A receives the, callResponse, and sends "startcommunication"with sdpAnswer.
pc.setRemoteDescription, from sdpAnswer is done.
onAddStream called. A remote renderer is added to the UI.
But no streaming is coming.
From A, B is receiving "iceCandidate". is anything to be done on this?
In both sides, I dont get the remote video But able to see local video
And I dont get any error.
In onAddRemoteStream change
VideoRendererGui.update(remoteRender, REMOTE_X, REMOTE_Y,   REMOTE_WIDTH,REMOTE_HEIGHT, scalingType)
add one more parameter after scalingType
 VideoRendererGui.update(remoteRender,
 REMOTE_X, REMOTE_Y,   REMOTE_WIDTH,REMOTE_HEIGHT, scalingType,true)
Hope this will help you.
you have it like this?
onAddRemoteStream(MediaStream remoteStream){
remoteStream.videoTracks.get(0).addRenderer(new VideoRenderer(remoteRender));
}
In some case you can not receive video if not sending video.
Workarounded with this: https://stackoverflow.com/a/51883182/571410

aprirtc call_crossing_detected error when calling from android to android

My ionic angularjs corodova app works great when receiving calls from the demo web page on chrome. When I try to initiate a call to the demo site or another device, whether using demo API key or real api key, i get
call_crossing_detected
What does this mean, and how do you fix it?
More details on symptoms. When this occurs, no video comes up and the initiating device shows the error and the call button remains. But the receiving device switches to the hangup button, which then works. And if you speak into either device the receiving device receives the audio, but nothing on the initiating device
"call_crossing_detected" reason appears on hangup event when a call is already established between the two users and you are trying to establish a new one.
So I think you may have an issue on the first call hangup.
I have resolved this issue. It was caused by apiRTC.init executing more than once.

Android TurnBasedMultiplayer calling takeTurn() doesnt generate a onTurnBasedMatchReceived()

I am writing a Multiplayer game using Google's TurnBasedMultiplayer API and calling takeTurn(). I have three players in the game, and besides the player who is calling takeTurn, I am finding that one player receives the update and onTurnBasedMatchReceived() is correctly called, yet the other player doesn't receive the update, onTurnBasedMatchReceived() is not called.
Can someone supply me with a possible reason not all players are receiving the updates? I note that the player who doesn't receive the update needs to go back to the Match Inbox and choose the relevant match again, and then it can be seen that the game is in fact updated.
Is the player who is not receiving the updates completely in the match? A player who hasn't accepted an invitation won't receive calls to onTurnBasedMatchUpdated.
Additionally, when a player receives an invitation, this comes to an invitation listener, not a match updated listener. If you're trying to use the match updated listener for both, that would also explain why you're not getting an update.
Have you activated the listener. I use code like this on my main activity...
public class GameScreen extends Activity implements OnInvitationReceivedListener,
OnTurnBasedMatchUpdateReceivedListener {
...
}

Casting video to ChromeCast by Youtube app

I tried using a Android phone to cast to Chromecast device by Youtube app. I added some Videos to queue, then I used another phone to cast to Chromecast device. The second one automatically knows the videos added to queue on the first one.
I don't know how Youtube app can do this?
EDIT I guess Youtube app uses one custom data channel besides Media channel. When Video is added to queue, sender app will send somethings (eg: videoId) to receiver. Receiver will save it in array of video ID. When another phone connects to Chromecast device, It'll receiver array of video ID from the receiver. Can anyone give other solutions? Thanks
I guess what you are asking is how you can create a play list, potentially shared by multiple devices. If that is the case, you have a couple of choices:
keep the playlist in the receiver: this is the simplest option. This will be a simple array on the receiver, kept in memory, which will go away when application ends. A custom receiver is required and it can implement the methods such as "append, insert, get, clear, ... to provide what the senders need. When each sender connects, it can ask (calling 'get' for example) for the current "queue" and then can modify the queue by other methods such as 'clear', 'append', 'insert', .... Note that there is no long-term persistence on the receiver (local storage is available but will be cleared as son as the app is gone).
keep the playlist in the cloud: you need to do most of the things that you do in the previous option but you also persist the playlist to the cloud; the advantage is that playlist lasts beyond the life of a session (this may or may not be desired). In addition, sender apps can potentially get the playlist fro the cloud directly, if needed.
The important thing is that the main storage for your playlist is not your sender devices; they don't know (and shouldn't know) abut the presence of other senders in the eco-system.
On the receiver side, we recently published a simple sample that sows how the notion of (local) playlist can be implemented; that is a simplified example but is enough to show that with minimal work, you can take advantage of the Media Channel; for more sophisticated handling of a shared queue, you definitely need an out-of-bound channel/namespace to handle all the additional api's that I mentioned above.

How to automatically answer call and play prerecorded sound out to the caller and DTMF on Android

Could it be possible now, which we can develop an Android application having the following requirement for its working steps
Automatic receive the call, then
Play some sound out to the caller, wait for DTMF response, then
Record the caller sound (in the case that they permit, by pressing 1 as DTMF response)
Callee can play back the recoreded sound later.
Thank for all answers in advance .....
Hey I am also making same application...for Automatic receive call you need to change Source Code of android. I have done it successfully with froyo 2.2. There is method answerCall(Phone phone) in PhoneUtils.java file with that you can automatic receive call.
I am also searching for DTMF....but till now i didn't get anything which can be helpful....for DTMF decoding....
the first point seems possible. check the state of call if it is ringing state the program can auto attend it for you..you can find more information in this link.
http://www.devlper.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/
http://prasanta-paul.blogspot.com/2010/09/call-control-in-android.html

Categories

Resources