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.omniture.basic; /* ww w.j a v a2 s.c o m*/ import android.app.ActionBar; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.WindowManager; import android.widget.MediaController; import android.widget.RelativeLayout; import com.brightcove.omniture.OmnitureComponent; import com.brightcove.player.event.Event; import com.brightcove.player.event.EventEmitter; import com.brightcove.player.event.EventListener; import com.brightcove.player.event.EventLogger; import com.brightcove.player.event.EventType; import com.brightcove.player.media.Catalog; import com.brightcove.player.media.PlaylistListener; import com.brightcove.player.model.Playlist; import com.brightcove.player.model.Video; import com.brightcove.player.view.BrightcovePlayer; import com.brightcove.player.view.BrightcoveVideoView; /** * This app illustrates how to use the Omniture plugin with the Brightcove Player for Android. * * @author Billy Hnath */ public class MainActivity extends BrightcovePlayer { private final String TAG = this.getClass().getSimpleName(); private EventEmitter eventEmitter; private OmnitureComponent omnitureComponent; @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.omniture_activity_main ); brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view); super.onCreate(savedInstanceState); eventEmitter = brightcoveVideoView.getEventEmitter(); setupOmniture(); // Add a test video to the BrightcoveVideoView. 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); } }); } private void setupOmniture() { // Initializing the Omniture plugin with the JSON configuration file // and evar rulesets should be enough to get started. omnitureComponent = new OmnitureComponent(eventEmitter, this, "Android Sample App", "Android Sample Player"); } }