devin1014 / dlna-cast Goto Github PK
View Code? Open in Web Editor NEW基于Cling库封装的DLNA投屏库,支持DMC、DMS、DMR功能。
基于Cling库封装的DLNA投屏库,支持DMC、DMS、DMR功能。
大佬这个项目很棒啊,有博客或文档么,好好学习下,我自己做的app想加本地投屏功能
和投影仪连接的不是同一个wifi,但是一直在搜索,也没报错
就是两台手机,连接后,一台设备显示使用投屏这个设备的屏幕?
本地文件选择后的播放路径是:http://192.168.1.101:8192/storage/emulated/0/yyy/ppppp.mp4
1.投屏播放网络文件是可以的
2.发现有报错
W/System.err: java.lang.RuntimeException: Null or empty XML
W/System.err: at org.fourthline.cling.support.lastchange.LastChangeParser.parse(LastChangeParser.java:108)
W/System.err: at com.android.cast.dlna.dmc.control.CastSubscriptionCallback.eventReceived(CastSubscriptionCallback.java:72)
W/System.err: at org.fourthline.cling.controlpoint.SubscriptionCallback$2.eventReceived(SubscriptionCallback.java:223)
W/System.err: at org.fourthline.cling.model.gena.RemoteGENASubscription.receive(RemoteGENASubscription.java:114)
W/System.err: at org.fourthline.cling.protocol.sync.ReceivingEvent$2.run(ReceivingEvent.java:131)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:929)
W/System.err: java.lang.RuntimeException: Null or empty XML
W/System.err: at org.fourthline.cling.support.lastchange.LastChangeParser.parse(LastChangeParser.java:108)
W/System.err: at com.android.cast.dlna.dmc.control.CastSubscriptionCallback.eventReceived(CastSubscriptionCallback.java:72)
W/System.err: at org.fourthline.cling.controlpoint.SubscriptionCallback$2.eventReceived(SubscriptionCallback.java:223)
W/System.err: at org.fourthline.cling.model.gena.RemoteGENASubscription.receive(RemoteGENASubscription.java:114)
W/System.err: at org.fourthline.cling.protocol.sync.ReceivingEvent$2.run(ReceivingEvent.java:131)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:929)
您能帮忙看下是哪里的问题吗?
你好
请问是否有接口可以设置header
被挤下线了没处理?
我利用手机可以投射到电脑(win Media player)播放视频,可以用电脑不能反向操作(电脑可播放设备列表无对应设备),请问怎们才能支持?
使用bilibili,爱奇艺,腾讯视频等主流播放器,能够投屏到TV接收断,但是很快显示“播放结束”,无法控制音量,进度等。
播放失败(1,0)是什么原因导致的
您好,我们这边发现在创维电视的爱投屏,都无法投屏成功,看您的Demo截图有创维电视,想问一下您是可以投屏成功的吗?是否有需要传递什么特定的参数。然后我们也发现电信盒子也无法投屏成功。但也都没有回调失败信息。
Renderer 端目前只能正常播放和控制 M3u8: Iphone Sample 这一个
其它的MP4, M3u8:BT, M3u8:CC 和 图片, Rendere 都不能正常播放和现实。
请问如何需要如何解决呢,期待您的回复
共享网络mp4视频成功,网络视频地址:http://121.199.61.174/testhtml5.mp4
共享手机本地mp4视频失败
做DMR端的视频接收成功,图片没有成功过
老哥,远程依赖版本是多少?
非常感谢您贡献的开源代码!
我在运行过程中发现了一个问题,我的本地编译环境是
Android Studio AI-212.5712.43.2112.8609683
jdk 8
gradle plugin version 4.2.0
gradle 6.7.1
在投射本地视频的时候,jetty提供的网址访问出现503错误,查资料可能是版本不匹配的问题
未重构前可以,大佬能否修复一下!
本地文件选择后的播放路径是:http://192.168.1.101:8192/storage/emulated/0/yyy/ppppp.mp4
1.投屏播放网络文件是可以的
2.发现有报错
W/System.err: java.lang.RuntimeException: Null or empty XML
W/System.err: at org.fourthline.cling.support.lastchange.LastChangeParser.parse(LastChangeParser.java:108)
W/System.err: at com.android.cast.dlna.dmc.control.CastSubscriptionCallback.eventReceived(CastSubscriptionCallback.java:72)
W/System.err: at org.fourthline.cling.controlpoint.SubscriptionCallback$2.eventReceived(SubscriptionCallback.java:223)
W/System.err: at org.fourthline.cling.model.gena.RemoteGENASubscription.receive(RemoteGENASubscription.java:114)
W/System.err: at org.fourthline.cling.protocol.sync.ReceivingEvent$2.run(ReceivingEvent.java:131)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:929)
W/System.err: java.lang.RuntimeException: Null or empty XML
W/System.err: at org.fourthline.cling.support.lastchange.LastChangeParser.parse(LastChangeParser.java:108)
W/System.err: at com.android.cast.dlna.dmc.control.CastSubscriptionCallback.eventReceived(CastSubscriptionCallback.java:72)
W/System.err: at org.fourthline.cling.controlpoint.SubscriptionCallback$2.eventReceived(SubscriptionCallback.java:223)
W/System.err: at org.fourthline.cling.model.gena.RemoteGENASubscription.receive(RemoteGENASubscription.java:114)
W/System.err: at org.fourthline.cling.protocol.sync.ReceivingEvent$2.run(ReceivingEvent.java:131)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:929)
您能帮忙看下是哪里的问题吗?
設備列表有顯示 Kodi 呀
我导入了api 'devin1014.android:dlna-dmc:1.0.0'没法在声明中添加
在AndroidManifest.xml中需要添加如下
投屏时,怎么携带header
java.lang.ExceptionInInitializerError
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.createServlet(AsyncServletStreamServerImpl.java:98)
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.init(AsyncServletStreamServerImpl.java:76)
at org.fourthline.cling.transport.RouterImpl.startAddressBasedTransports(RouterImpl.java:434)
at org.fourthline.cling.transport.RouterImpl.enable(RouterImpl.java:132)
at org.fourthline.cling.android.AndroidRouter.enable(AndroidRouter.java:91)
at org.fourthline.cling.UpnpServiceImpl.(UpnpServiceImpl.java:87)
at org.fourthline.cling.android.AndroidUpnpServiceImpl$1.(AndroidUpnpServiceImpl.java:54)
at org.fourthline.cling.android.AndroidUpnpServiceImpl.onCreate(AndroidUpnpServiceImpl.java:54)
at com.android.cast.dlna.dmc.DLNACastService.onCreate(DLNACastService.java:22)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3967)
at android.app.ActivityThread.-wrap5(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2092)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
2022-08-18 21:13:48.900 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: │ Thread: cling-10
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: │ [客厅极光TV(dlna)] discovery failed...
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: │ Thread: cling-10
2022-08-18 21:13:48.901 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
2022-08-18 21:13:48.902 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast: │ org.fourthline.cling.model.ValidationException: Validation of device graph failed, call getErrors() on exception
2022-08-18 21:13:48.902 17063-18089/com.android.cast.dlna.demo E/DLNA_Cast:
断开连接了,投屏还在播放!!
/**
投屏
/
class TpActivity : BaseActivity(R.layout.cling_dialog),
OnDeviceRegistryListener {
private val clingDeviceAdapter by lazy { ClingDeviceAdapter() }
private val deviceList = mutableListOf<Device<, *, *>>()
companion object {
private const val TAG = "ClingListDialog"
fun startTpActivity(context: Context, title: String, url: String, img: String, id: String) {
val intent = Intent(context, TpActivity::class.java)
intent.putExtra("title", title)
intent.putExtra("url", url)
intent.putExtra("img", img)
intent.putExtra("id", id)
context.startActivity(intent)
}
}
private var title: String = ""
private var url: String = ""
private var img: String = ""
private var id: String = ""
override fun initView(savedInstanceState: Bundle?) {
title = intent?.getStringExtra("title") ?: title
url = intent?.getStringExtra("url") ?: url
img = intent?.getStringExtra("img") ?: img
id = intent?.getStringExtra("id") ?: id
DLNACastManager.getInstance().registerDeviceListener(this)
mBinding.apply {
wifi = "当前wifi:<${Utils.getWiFiInfoSSID(this@TpActivity)}>"
ivClose.setOnClickListener { finish() }
clingRecycler.addLinearManager()
clingDeviceAdapter.setList(deviceList)
clingDeviceAdapter.setOnItemClickListener { _, _, position ->
clingDeviceAdapter.setSelectedDevice(clingDeviceAdapter.getItem(position))
// startActivity(Intent(requireContext(), TpActivity::class.java))
}
clingRecycler.adapter = clingDeviceAdapter
}
}
override fun initData() {
}
override fun onStart() {
super.onStart()
DLNACastManager.getInstance().bindCastService(this)
}
override fun onStop() {
DLNACastManager.getInstance().unbindCastService(this)
super.onStop()
}
override fun onDestroy() {
DLNACastManager.getInstance().unregisterListener(this)
super.onDestroy()
}
override fun onDeviceAdded(device: Device<*, *, *>?) {
device?.also {
if (!deviceList.contains(it)) {
deviceList.add(it)
}
}
}
override fun onDeviceUpdated(device: Device<*, *, *>?) {
}
override fun onDeviceRemoved(device: Device<*, *, *>?) {
if (deviceList.contains(device)) {
deviceList.remove(device)
}
}
}
有添加以下依賴
implementation 'com.github.devin1014.DLNA-Cast:dlna-dmc:V1.0.0'
maven { url 'https://jitpack.io' }
maven {
url 'http://4thline.org/m2'
allowInsecureProtocol = true
}
有没有在dmr端获取,,dmc端设备信息如ip或者其他设备的信息方法?
rendere dlna-dmr 模块功能还会继续更新维护吗?
请教一下该怎么使用DMR的功能呢,比如怎么实现播放器相关的接口?怎么把当前设备作为播放器端暴露到网络中,让别的设备可以搜索到,然后播放其他软件投送的视频?
1,我们项目分手机端和TV端,手机端已经做好了,TV端基于作者项目renderer开发的;
2,手机端投射到TV端,播放m3u8格式电视剧,现象:加载一会儿之后,直接跳到下一集了(第一集跳到第二集,第二集加载一会儿之后跳到第三集);
3,把视频地址单独拿出来,放在demo里面的app端,通过app端投射是可以正常播放的;
4,麻烦作者帮忙看下大概是什么原因?
currentURIMetaData包含了投屏过来的标题等信息,有的第三方投屏投屏过来只有currentURI,而currentURIMetaData为空时就会报错,
Error: Current state of service prevents invokingthat action. Parameter specified as non-null is null:method com.android.cast.dlna.dmr. service.AVTransportServicelmpl.setAVTransportURl, parametercurrentURlMetaData. (HT TP response was: 500
Internal Server Error)
大佬能修改为可空吗!
播放本地视频时,如果本地文件的文件名有空格,会失败,报4
您好,看到您的Demo里搜索设备的时候第一个参数传的是null,这个参数应该怎么传,有什么区别?
DLNACastManager.getInstance().search(null, maxSeconds);
Hi,
When I try to open a mp4 file from my mobiles internal storage an error appears.
Error: Resource not found (HTTP response was: 500 internal server Error)
Please help me to figure out this problem and solve it.
Thanks.
这边测试发现,使用提前投屏软件进行爱投屏电视投屏的时候,电视会弹窗询问是否允许,用DLNA_Cast进行投屏,电视不会弹出询问,投屏无法成功。是不是缺少了什么参数?
没有版本地址
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.