Please Wait...

Cancel

How to open an embedded video?

Rate
  • Very helpful
  • Could be better
  • Not helpful
Print

To open an embedded video, you need to implement the listener PDFLayoutListener and in the method OnPDFOpenMovie, you can either open the system intent or a custom one...

To open a video using the system intent:

public void OnPDFOpenMovie(String path) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(path));
startActivity(intent);
}

To open a video using a custom intent:

public void OnPDFOpenMovie(String path) {
Intent intent =
new Intent(this, VideoPlayer.class);
intent.putExtra("VIDEOPATH", mVideoPath);
startActivity(intent);
}

VideoPlayer:
public class VideoPlayer extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.
activity_video_player);

VideoView video_player_view = (VideoView) findViewById(R.id.video_player_view);
video_player_view .setMediaController(new
MediaController(this));
video_player_view .setVideoPath(getIntent().getStringExtra(
"VIDEOPATH"));
video_player_view .start();
}
}

activity_video_player.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

<VideoView
android:id="@+id/video_player_view"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
Applies To

RadaeePDF SDK for Android

Details

Created : 2016-12-09 10:02:40, Last Modified : 2016-12-09 10:08:34

Close
You are now being logged in using your Facebook credentials