创建显示在WebView顶部的精简TvView。这是专门用于直播电视的。
(我见过许多解决流内容的解决方案,但这是针对通过同轴电缆传输的视频的。)
该网页视图部分工作正常,我已经了解到,RelativeLayout的是为了要求层的意见。
另外,TvView似乎没有被识别,因此我猜测我可能需要使用SurfaceView。
我已经看过TvInput示例应用程序,但是这太过分了。我不是在尝试重新创建TvInput服务,而只是在现有框架上加以利用。
我到处搜寻答案,但似乎找不到任何东西。
预先感谢您的协助。
根据要求由桐油。
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_browse_fragment"
android:name="com.company.app.MainFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.company.app.MainActivity"
tools:deviceIds="tv"
tools:ignore="MergeRootFrame" >
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TvView
android:id="@+id/TvView"
android:layout_width="816dp"
android:layout_height="404dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp" />
</RelativeLayout >
Run Code Online (Sandbox Code Playgroud)
MainActivity.java
package com.company.app;
import android.annotation.SuppressLint;
import android.app.Activity;
import …Run Code Online (Sandbox Code Playgroud)