Playback of clear content

To enable users to watch clear content, you must create and configure an NMPVideoView object.  

Additional steps are required to watch protected content.

Prerequisites

  • The SDK must have been created.

  • A clear stream is available for testing.

If your streaming content is being served over HTTPS, you may need to disable SSL verification under certain circumstances. See Disable SSL verification.

Example code

The following code shows how to enable users to watch clear content:

/* NMPVideoView startup example */
@Override
public void onCreate(Bundle xSavedInstanceState) {
  super.onCreate(xSavedInstanceState);
  …
  //Switching to video_screen
  setContentView(R.layout.video_screen);

  //Creating VideoView
  NMPVideoView videoView = new NMPVideoView(this);

  //Adding VideoView to video_display_area
  FrameLayout mainContent = (FrameLayout)
      findViewById(R.id.video_display_area);
  mainContent.addView(videoView);

  //Creating MediaController
  MediaController mediaController = new MediaController(this);
  mediaController.setAnchorView(videoView);

  //Setting up VideoView
  videoView.setMediaController(mediaController);
  videoView.setOnPreparedListener(this);
  videoView.setOnCompletionListener(this);
  videoView.setOnErrorListener(this);
  videoView.setVideoURI(Uri.parse(url));
  videoView.requestFocus();

  //Starting VideoView
  videoView.start();
  …   
}

See the NMPVideoView class reference for details of the API calls used above.