Can we cleanup surface view?

sachin

New Member
I am streaming to N number of user. And any viewer can have video chat with streamer/ broadcaster. During video chat when i close small window of second person on chat, his last frame always remains on surface view (even video chat is closed from second person end). How can i refresh the streaming surface view or anything else so that small window get removed.
please refer to screenshot attached.
 

Attachments

  • app screenshot.png
    app screenshot.png
    814.5 KB · Views: 432
Surface view can be cleaned up with method release(), for example (we test it on Streaming-min sample application)
Code:
/**
 * Those modules should be imported for renderer cleaning to work
 */
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
...
/**
 * Example with streamer and player.
 * Demonstrates how to publish a video stream while playing another one.
 */
public class StreamingMinActivity extends AppCompatActivity {
                ...
                if (mPlayButton.getTag() == null || Integer.valueOf(R.string.action_play).equals(mPlayButton.getTag())) {
                    /**
                     * The options for the stream to play are set.
                     * The stream name is passed when StreamOptions object is created.
                     */
                    StreamOptions streamOptions = new StreamOptions(mPlayStreamView.getText().toString());

                    /**
                     * Stream is created with method Session.createStream().
                     */
                    playStream = session.createStream(streamOptions);
                    ...
                    /**
                     * Method Stream.play() is called to start playback of the stream.
                     */
                    playStream.play();
                    ...
                } else {
                    /**
                     * Method Stream.stop() is called to stop playback of the stream.
                     */
                    playStream.stop();
                    playStream = null;
                    remoteRender.release();
                }
                ...
}
Note that surface view will be filled black after cleaning up.
 
Top