protected internal override 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. ContentView = R.layout.adobepass_activity_main; brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view); eventEmitter = brightcoveVideoView.EventEmitter; base.onCreate(savedInstanceState); // configure the AdobePass AccessEnabler library try { accessEnabler = AccessEnabler.Factory.getInstance(this); if (accessEnabler != null) { accessEnabler.Delegate = this; accessEnabler.useHttps(true); } } catch (AccessEnablerException e) { Log.e(TAG, "Failed to initialize the AccessEnabler library: " + e.Message); return; } string requestorId = Resources.getString([email protected]_id); string credentialStorePassword = Resources.getString([email protected]_store_password); System.IO.Stream credentialStore = Resources.openRawResource(R.raw.adobepass); // A signature must be passed along with the requestor id from a private key and a password. PrivateKey privateKey = extractPrivateKey(credentialStore, credentialStorePassword); string signedRequestorId = null; try { signedRequestorId = generateSignature(privateKey, requestorId); } catch (AccessEnablerException e) { Log.e(TAG, "Failed to generate signature."); } // The production URL is the default when no URL is passed. If // we are using a staging requestorID, we need to pass the staging // URL. List<string> spUrls = new List<string>(); spUrls.Add(STAGING_URL); // Set the requestor ID. accessEnabler.setRequestor(requestorId, signedRequestorId, spUrls); // TODO (once we media API changes are made): // Media API call will return result with nulled out URL fields if the media // is protected. We need to make the adobepass calls to get the token for the media, // then make another Media API call with the adobepass token included (in the header or // a cookie) which will return a result with non-nulled URL fields. // 1. Ignore URL fields on the first call. // 2. Make the AdobePass calls // 3. Add token to next Media API call. // Add a test video to the BrightcoveVideoView. IDictionary<string, string> options = new Dictionary<string, string>(); IList<string> values = new List<string>(Arrays.asList(VideoFields.DEFAULT_FIELDS)); Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A.."); catalog.findPlaylistByReferenceID("stitch", options, new PlaylistListenerAnonymousInnerClassHelper(this)); }
protected internal override 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. ContentView = R.layout.adobepass_activity_main; brightcoveVideoView = (BrightcoveVideoView)findViewById(R.id.brightcove_video_view); eventEmitter = brightcoveVideoView.EventEmitter; base.onCreate(savedInstanceState); // configure the AdobePass AccessEnabler library try { accessEnabler = AccessEnabler.Factory.getInstance(this); if (accessEnabler != null) { accessEnabler.Delegate = this; accessEnabler.useHttps(true); } } catch (AccessEnablerException e) { Log.e(TAG, "Failed to initialize the AccessEnabler library: " + e.Message); return; } string requestorId = Resources.getString([email protected]_id); string credentialStorePassword = Resources.getString([email protected]_store_password); System.IO.Stream credentialStore = Resources.openRawResource(R.raw.adobepass); // A signature must be passed along with the requestor id from a private key and a password. PrivateKey privateKey = extractPrivateKey(credentialStore, credentialStorePassword); string signedRequestorId = null; try { signedRequestorId = generateSignature(privateKey, requestorId); } catch (AccessEnablerException e) { Log.e(TAG, "Failed to generate signature."); } // The production URL is the default when no URL is passed. If // we are using a staging requestorID, we need to pass the staging // URL. List <string> spUrls = new List <string>(); spUrls.Add(STAGING_URL); // Set the requestor ID. accessEnabler.setRequestor(requestorId, signedRequestorId, spUrls); // TODO (once we media API changes are made): // Media API call will return result with nulled out URL fields if the media // is protected. We need to make the adobepass calls to get the token for the media, // then make another Media API call with the adobepass token included (in the header or // a cookie) which will return a result with non-nulled URL fields. // 1. Ignore URL fields on the first call. // 2. Make the AdobePass calls // 3. Add token to next Media API call. // Add a test video to the BrightcoveVideoView. IDictionary <string, string> options = new Dictionary <string, string>(); IList <string> values = new List <string>(Arrays.asList(VideoFields.DEFAULT_FIELDS)); Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A.."); catalog.findPlaylistByReferenceID("stitch", options, new PlaylistListenerAnonymousInnerClassHelper(this)); }