使用 Java 代码访问 DLNA 电视

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7285260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 19:25:10  来源:igfitidea点击:

Access DLNA TV with Java code

javadlna

提问by Philipp

I want to control my DLNA TV from my Java program on my PC. In particular, I want to:

我想通过我 PC 上的 Java 程序控制我的 DLNA 电视。我特别想:

  • discover if there's a TV in the LAN
  • check whether it is currently ON (for a first step)
  • later send some commands (eg. OFF) to it
  • 发现局域网中是否有电视
  • 检查它当前是否打开(第一步)
  • 稍后向它发送一些命令(例如关闭)

I believe, I need to implement the Digital Media Controller (DLNA-DMC) profile. Is there a Java library which allows me to do this easily?

我相信,我需要实现数字媒体控制器 (DLNA-DMC) 配置文件。是否有一个 Java 库可以让我轻松地做到这一点?

I couldn't find much doc on this. Are the APIs under NDA?

我在这方面找不到太多文档。API 是否属于保密协议?

Can you recommend some reading?

你能推荐一些阅读吗?

回答by Riduidel

Take a look at Cling. I'm not sure it implements the UPnP control pointfeatures you're in fact looking for, but at least it's a starting point.

看看Cling。我不确定它是否实现了您实际上正在寻找的UPnP 控制点功能,但至少它是一个起点。

回答by simonc

ohNetdoes exactly what you want.

ohNet正是您想要的。

It is available under BSD license and includes the control point stack you need and can generate code to greatly simplify use of the services in any profile (see the docs on ohNetGen).

它在 BSD 许可下可用,包括您需要的控制点堆栈,并且可以生成代码以大大简化任何配置文件中服务的使用(请参阅 ohNetGen 上的文档)。

(Disclaimer: I have contributed to this project)

(免责声明:我为这个项目做出了贡献)

回答by Shiv

Intel DLNA tools allows you to create DLNA control point very easily for any platform in any language c,c++, C#, Java. Try Intel? Software for UPnP* Technology: Download Tools

英特尔 DLNA 工具允许您使用任何语言 c、c++、C#、Java 为任何平台非常轻松地创建 DLNA 控制点。试试英特尔?UPnP* 技术软件:下载工具

They even have tools to test you app.

他们甚至有工具来测试你的应用程序。