I have a basic fragment with the following XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<com.wowza.gocoder.sdk.api.player.WOWZPlayerView
android:id="@+id/videoPlayerView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout
My application is using a single theme across all of its pages:
<style name="Theme.Foo" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowIsTranslucent">false</item>
<!-- General theme colors -->
<item name="colorPrimary">@color/fooColorPrimary</item>
<item name="colorPrimaryDark">@color/fooColorPrimaryDark</item>
<item name="colorAccent">@color/fooColorAccent</item>
<item name="android:background">@color/fooBackground</item>
My issue is that because the background of WOWZPlayerView
is being set by the theme, as is its outer linear layout background, it causes it to appear invisible.
I’ve tried making the WOWZPlayerView
not take the background of the theme by setting on it:
android:background="@null"
android:theme="@android:style/Theme.Holo.Light"
However its background was still being set. I am certain this is the case since in commenting out the
<item name="android:background">@color/fooBackground</item>
portion of my theme definition do I see the video being played.
Fix is to not allow the WOWZPlayerView
have setBackground(Drawable background)
yield any effect.
TL;DR: WOWZPlayerView shouldn’t expose its setBackground
method or simply have it no-op.