Skip to main content
Skip table of contents

Adding a video view element

Use this to add an OTVVideoView element to the layout:

  1. Expand app > src > main > res > layout and open the activity_main.xml file.

  2. Select Code view and create a nagra.otv.sdk.OTVVideoView by replacing the contents with:

    XML
    <?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity">
     
          <nagra.otv.sdk.OTVVideoView
              android:id="@+id/otvVideoView"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_centerInParent="true"
              android:descendantFocusability="afterDescendants" />
     
    </android.support.constraint.ConstraintLayout>

The OTVVideoView element works as the principal UI element when part of a layout. Placing any other elements on top of the video view’s area will produce unpredictable effects and interfere with the built-in security measures.

Next step: You should now be able to run the app in clear playback mode.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.