如何在Brightcove播放器中强制全屏显示? 我已将BrightcoveExoPlayerVideoView放入Android的标准design.widget.AppBarLayout中,它停止工作-没有全屏支持。
问题在于,全屏在AppBarLayout外部可以正常工作,而在其中却无法正常工作。
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- PLAYER'S FULLSCREEN WORKS HERE -->
<!--<com.brightcove.player.view.BrightcoveExoPlayerVideoView-->
<!--android:id="@+id/brightcove_video_view"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="280dp"-->
<!--android:layout_gravity="center_horizontal|top"-->
<!--android:contentDescription="sample content description"-->
<!--android:fitsSystemWindows="true"-->
<!--android:paddingTop="16dp"-->
<!--android:scaleType="fitXY"-->
<!--app:layout_collapseMode="parallax"/>-->
<android.support.design.widget.CoordinatorLayout
android:id="@+id/video_details_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00FF00"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/video_details_appbar"
android:layout_width="match_parent"
android:layout_height="240dp"
android:background="#00FF00"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:fitsSystemWindows="true"
app:contentScrim="#FF0000"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:statusBarScrim="#FF0000">
<!-- PLAYER'S FULLSCREEN DOES NOT WORK HERE -->
<com.brightcove.player.view.BrightcoveExoPlayerVideoView
android:id="@+id/brightcove_video_view"
android:layout_width="match_parent"
android:layout_height="280dp"
android:layout_gravity="center_horizontal|top"
android:contentDescription="sample content description"
android:fitsSystemWindows="true"
android:paddingTop="16dp"
android:scaleType="fitXY"
app:layout_collapseMode="parallax"/>
<android.support.v7.widget.Toolbar
android:id="@+id/video_details_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<ImageView
android:id="@+id/video_details_back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="Sample description"
android:padding="8dp"
android:src="@drawable/ic_back"/>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/video_details_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/video_details_content_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:orientation="vertical">
<TextView
android:id="@+id/video_details_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:fontFamily="sans-serif"
android:lineSpacingExtra="6sp"
android:text="SAMPLE CATEGORY"
android:textAllCaps="true"
android:textColor="#FF0000"
android:textSize="12sp"
android:textStyle="bold"
tools:text="HIGHLIGHTS"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
主要活动:
public class MainActivity extends BrightcovePlayer {
[...]
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);
brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
[...]
}
[...]
}