android 视频通话窗口切换,仿微信视频通话大小视图切换(SurfaceView实现)

本文介绍了如何在Android项目中实现视频通话的窗口切换,类似微信视频通话的功能。通过SurfaceView实现,详细讲解了布局设计和代码实现,包括全屏显示和刘海屏适配,以及大小视图的切换方法。
摘要由CSDN通过智能技术生成

前言

前一段时间做了一个即时通讯的项目,在项目中遇到很多坑,有时间一一做个总结,项目消息发送基于XMPP+Tigase,语言视频通话基于PJSIP+FreeSWITCH,项目UI仿微信。做到视频通话时,遇到本地视图与远程视图切换,网上搜了一篇相关的博客:https://blog.csdn.net/xuedaqian123/article/details/77878781,根据大神思路写了这个Demo,其中用的是第三直播源可能有点不稳定,切换过程可能存在黑屏和无响应的情况,但是用的Pjsip中切换还是很流程的;

布局

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context="com.demo.surfaceviewdemo.MainActivity">

android:layout_width="match_parent"

android:layout_height="match_parent">

android:id="@+id/rl_remote"

android:layout_width="match_parent"

android:layout_height="wrap_content">

android:id="@+id/surfaceview_remote"

android:layout_width="match_parent"

android:layout_height="match_parent"/>

android:id="@

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值