OfficeDev / skype-android-app-sdk-samples

This repo contains Android samples powered by the Microsoft Skype for Business App SDK. Samples developed using Android Studio
MIT License
51 stars 52 forks source link

How to tell if video of remote participant is pause/unpause (APP SDK)? #39

Open dcmen opened 7 years ago

dcmen commented 7 years ago

I use below code: ParticipantVideo participantVideo = this.remoteParticipantLeader.getParticipantVideo(); participantVideo.subscribe(this.mmvrSurfaceView);

            participantVideo.addOnPropertyChangedCallback(new   Observable.OnPropertyChangedCallback() {
                @Override
                public void onPropertyChanged(Observable observable, int i) {
                    final ParticipantVideo ppVideo = (ParticipantVideo) observable;
                    ppVideo.isPaused()
                }
            });

But ppVideo.isPaused() alway return false. Plz help me

guoGavin commented 7 years ago

Me too.

participantVideo.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
    @Override
    public void onPropertyChanged(Observable observable, int i) {
        if(observable instanceof ParticipantVideo) {
            switch (i) {
                case ParticipantVideo.PARTICIPANT_VIDEO_PAUSED_PROPERTY_ID:
                    //get pause status
                    break;
            }
        }
};
VincentH-Net commented 7 years ago

I have a workaround for this bug, which lets me detect remote video pause/unpause so I can hide or show the remote video view on remote video (un)pause.

I encountered this defect in the SfB Android App SDK, in all versions from 0.5 to the current 1.1 Hopefully the SfB App SDK for Android team will fix this soon! Are you watching guys?

Here is my workaround :

  1. Join the meeting with the remote video view hidden
  2. In the OnFrameRendered method of your MMVRSurfaceView.IMMVRCallback implementation, unhide the remote video view if it is hidden. Also set a flag that frames were rendered.
  3. Before you subscribe to an external video stream, clear the rendered flag
  4. In your external video paused property changed handler, check the rendered flag to see whether we are currently paused. Then simply toggle the remote video view visibility to the other state and set the rendered flag to match the new state.

This works reasonably well in most meeting connect flows but it is a bit brittle; missing paused changed messages can result in the video window remaining visible while external video is paused.

rahulyaa commented 7 years ago

@dcmen @guoGavin @VincentH-Net I will look into this one. Thanks for reporting this.

VincentH-Net commented 7 years ago

@rahulyaa any progress on this? Is it fixed in 1.0.3? (1.0.3 has been out for 10 days now but without any release notes on what was fixed / changed. 1.0.3 is not even mentioned on https://msdn.microsoft.com/en-us/skype/appsdk/releasenotes)