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.player.samples.hls.basic; //w w w . ja v a 2 s . c o m import android.os.Bundle; import android.util.Log; import com.brightcove.player.media.Catalog; import com.brightcove.player.media.PlaylistListener; import com.brightcove.player.model.Playlist; import com.brightcove.player.view.BrightcovePlayer; import com.brightcove.player.view.SeamlessVideoView; /** * This app illustrates how to use the Brightcove HLS player for * Android. * * @author Paul Matthew Reilly */ public class MainActivity extends BrightcovePlayer { private final String TAG = this.getClass().getSimpleName(); @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. Establish the video object and use it's event emitter to get important // notifications and to control logging. setContentView(R.layout.activity_main); brightcoveVideoView = (SeamlessVideoView) findViewById(R.id.brightcove_video_view); super.onCreate(savedInstanceState); Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A.."); catalog.findPlaylistByReferenceID("stitch", new PlaylistListener() { public void onPlaylist(Playlist playlist) { brightcoveVideoView.addAll(playlist.getVideos()); } public void onError(String error) { Log.e(TAG, error); } }); // Log whether or not instance state in non-null. if (savedInstanceState != null) { Log.v(TAG, "Restoring saved position"); } else { Log.v(TAG, "No saved state"); } } }