Back to project page android-player-samples.
The source code is released under:
Apache License
If you think the Android project android-player-samples listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.brightcove.samples.android.bundledvideo.basic; //ww w . j a v a2 s. co m import android.net.Uri; import android.os.Bundle; import android.widget.MediaController; import com.brightcove.player.event.EventEmitter; import com.brightcove.player.model.Video; import com.brightcove.player.view.BrightcovePlayer; import com.brightcove.player.view.BrightcoveVideoView; /** * This app illustrates how to load and play a bundled video with the Brightcove Player for Android. * * @author Billy Hnath */ public class MainActivity extends BrightcovePlayer { @Override protected void onCreate(Bundle savedInstanceState) { // When extending the BrightcovePlayer, we must assign the BrightcoveVideoView // before entering the superclass. This allows for some stock video player lifecycle // management. setContentView(R.layout.bundled_video_activity_main ); brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view); super.onCreate(savedInstanceState); // Add a test video from the res/raw directory to the BrightcoveVideoView. String PACKAGE_NAME = getApplicationContext().getPackageName(); Uri video = Uri.parse("android.resource://" + PACKAGE_NAME + "/" + R.raw.shark); brightcoveVideoView.add(Video.createVideo(video.toString())); } }