TBS播放视频的一些记录

**

在AndroidManifest.xml中注册

**

 <!-- TBS播放器 -->
        <activity
            android:name="com.tencent.smtt.sdk.VideoActivity"
            android:alwaysRetainTaskState="true"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:exported="false"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="com.tencent.smtt.tbs.video.PLAY" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

直接调用播放视频

//判断当前是否可用
            if(TbsVideo.canUseTbsPlayer(context)){
                //播放视频
                Bundle extraData = new Bundle();
                extraData.putInt("screenMode",103);
                TbsVideo.openVideo(context, filePath,extraData);

            }

关于screenMode的做了几个尝试,不添加extraData时,自动竖屏全屏播放,要退出需要双击屏幕暂停后才会弹出选项框。screenMode=102时,竖屏全屏播放,有选项边框。
screenMode=103时,横屏全屏播放,有选项边框,但双击暂停后再次播放会崩溃。
screenMode=104时,竖屏全屏播放,有选项边框,没发现和102的区别。
screenMode=105时,竖屏全屏播放,为默认,和不添加一致。

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值