android sdk投屏,海豚星空扫码投屏 Android 接收端 SDK 集成 六步骤

扫码投屏,开放 络,独占设备,不需要额外下载软件,微信扫码,发现设备。支持标准DLNA协议,支持倍速播放。视频,音频,图片投屏。好点意思。还支持自定义基于 DLNA 扩展的操作动作。好像要收费,没体验。

这里简单记录一下集成过程。

一 跟目录的build.gradle添加私有mevan仓库

maven {url ‘http://nexus.dolphinstar.cn/repo/openmavenx’}

二 app/build.gradle

2.1 添加依赖

implementation ‘cn.dolphinstar:playerCore:3.0.20’

2.2 开启JAVA8支持

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

三 权限

四 络

注意 android 9后强制https,为了支持http。应在AndroidManifest.xml的Application节点添加

android:networkSecurityConfig=”@xml/network_security_config”

network_security_config.xml

五 申请AppId

前往 海豚星空平台 控制中心 注册并创建应用获取appId

在app/src/main/assets

添加文件dpsAppInfo

添加建值对

APPID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

六 启动服务

//启动配置

StartUpCfg cfg = new StartUpCfg();

cfg.PlayerName = “MY TV-” +(int) (Math.random() * 900 + 100);

cfg.AppSecret = “”; //APP的Secret

//启动服务

MYOUPlayer.of(MainActivity.this)

.StartService(cfg)

.subscribe(s -> {

//投屏服务启动成功

Log.e(“MainActivity”,”投屏服务启动成功”);

}, e -> {

//投屏服务启动失败

Log.e(“MainActivity”,”投屏服务启动失败:”+ e.getMessage());

});

完成!!!

相关资源:SRTApp:学生投票追踪器-其它代码类资源-CSDN文库

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年4月22日
下一篇 2021年4月22日

相关推荐