如何在没有频道uri的情况下推出Google Tv的直播电视应用?

时间:2013-07-18 14:42:21

标签: android-intent uri google-tv

我正在寻找一种方法来启动谷歌电视的直播电视应用程序的意图,而不给任何渠道uri。

我试过了:

Uri uri = Uri.parse("tv://");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

此代码在黑屏上启动Live Tv应用程序,我无法更改频道。

我也试过假uri,但这个技巧只让我这个吐司: “无法调到所请求的流”

当我手动启动Live Tv应用程序时,我可以通过按CH +和CH-按钮查看频道并浏览它们。

我无法使用uri,因为频道列表为空。

3 个答案:

答案 0 :(得分:1)

我找到了anwser!请点击此链接获取更多信息:Anymote to invoke keyevents on Google TV itsself

你可以通过意图启动没有频道uri的直播电视:

final Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("tv://passthrough"));
startActivity(intent);

答案 1 :(得分:0)

您将不得不使用频道列表api并自行管理频道详细信息。查看频道列表API - https://developers.google.com/tv/android/docs/gtv_provider

答案 2 :(得分:0)

一旦您知道来自您自己的频道数据源的频道号码,就应该通过Anymote将各个数字发送到电视(每个数字之间有一个延迟),以模拟用户输入该频道号码。这与各种Google TV设备以及各个国家/地区保持一致。

不要试图操纵电视Uri以使电视改变频道。 TV Uri格式不是标准化的,并且对于不同的Google TV设备制造商而言是不同的。以下是几个例子:

tv://channel/VODDM?deviceId=irb_0&channelNumber=250
tv://channel?deviceId=irb_0&channelNumber=250
tv://channel/EHD?deviceId=Time%20Warner%20Cable