public override void onLogMessage(int level, string area, string message) { switch (level) { case Log.DEBUG: Log.d(area, message); break; case Log.ERROR: Log.e(area, message); break; case Log.INFO: Log.i(area, message); break; case Log.VERBOSE: Log.v(area, message); break; case Log.WARN: Log.w(area, message); break; } }
internal LocalPlayer(PlayerController controller, Uri content, Uri subtitlesUri, SurfaceView videoView) { mController = controller; // Create and initialize Android MediaPlayer instance. mPlayer = new MediaPlayer(); mPlayer.OnCompletionListener = this; mSurfaceHolder = videoView.Holder; mSurfaceHolder.addCallback(this); bool isSurfaceValid = mSurfaceHolder.Surface.Valid; if (isSurfaceValid) { mPlayer.Display = mSurfaceHolder; } try { mPlayer.setDataSource(controller.mContext, content); mPlayer.prepare(); if (subtitlesUri != null) { mPlayer.addTimedTextSource(subtitlesUri.Path, MediaPlayer.MEDIA_MIMETYPE_TEXT_SUBRIP); mPlayer.OnTimedTextListener = this; } controller.Duration = mPlayer.Duration / 1000; } catch (IOException ignored) { Log.e("VideoPlayer", ignored.Message); } }
protected internal override string doInBackground(params Void[] @params) { string token = null; try { string scope = string.Format("oauth2:{0}", Scopes.PLUS_LOGIN); token = GoogleAuthUtil.getToken(outerInstance, Plus.AccountApi.getAccountName(outerInstance.mGoogleApiClient), scope); } catch (IOException transientEx) { /* Network or server error */ Log.e(TAG, "Error authenticating with Google: " + transientEx); errorMessage = "Network error: " + transientEx.Message; } catch (UserRecoverableAuthException e) { Log.w(TAG, "Recoverable Google OAuth error: " + e.ToString()); /* We probably need to ask for permissions, so start the intent if there is none pending */ if (!outerInstance.mGoogleIntentInProgress) { outerInstance.mGoogleIntentInProgress = true; Intent recover = e.Intent; startActivityForResult(recover, RC_GOOGLE_LOGIN); } } catch (GoogleAuthException authEx) { /* The call is not ever expected to succeed assuming you have already verified that * Google Play services is installed. */ Log.e(TAG, "Error authenticating with Google: " + authEx.Message, authEx); errorMessage = "Error authenticating with Google: " + authEx.Message; } return(token); }
protected internal override void onCreate(Bundle savedInstanceState) { ContentView = R.layout.activity_main; brightcoveVideoView = (BrightcoveVideoView)findViewById(R.id.brightcove_video_view); base.onCreate(savedInstanceState); vmapComponent = new VMAPComponent(brightcoveVideoView); View view = findViewById(R.id.ad_frame); if ((view != null) && (view is ViewGroup)) { vmapComponent.addCompanionContainer((ViewGroup)view); } else { Log.e(TAG, "Companion container must be an instance of a ViewGroup"); } Video video = Video.createVideo("http://media.w3.org/2010/05/sintel/trailer.mp4", DeliveryType.MP4); video.Properties.put(VMAPComponent.VMAP_URL, "http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator="); brightcoveVideoView.add(video); brightcoveVideoView.start(); }
public override void onGlobalLayout() { outerInstance.ViewTreeObserver.removeOnGlobalLayoutListener(this); if (outerInstance.Height / LOGICAL_HEIGHT != outerInstance.Width / LOGICAL_WIDTH) { Log.e(TAG, "Aspect ratio is incorrect. Expected " + LOGICAL_WIDTH / LOGICAL_HEIGHT + " got " + outerInstance.Width / outerInstance.Height); } // Set the conversion factor for pixels to logical (Firebase) model outerInstance.mScreenRatio = (float)OfficeCanvasView.this.Height / (float)LOGICAL_HEIGHT; outerInstance.mRenderUtil = new OfficeThingRenderUtil(Context, outerInstance.mScreenRatio); }
public virtual NotificationResult relayRemotePushNotificationPayload(Intent intent) { if (outerInstance.mSinchClient == null && outerInstance.mSettings.Username.Length > 0) { outerInstance.createClient(outerInstance.mSettings.Username); } else if (outerInstance.mSinchClient == null && outerInstance.mSettings.Username.Length == 0) { Log.e(TAG, "Can't start a SinchClient as no username is available, unable to relay push."); return(null); } return(outerInstance.mSinchClient.relayRemotePushNotificationPayload(intent)); }
public override void onConnectionFailed(ConnectionResult result) { if (!mGoogleIntentInProgress) { /* Store the ConnectionResult so that we can use it later when the user clicks on the Google+ login button */ mGoogleConnectionResult = result; if (mGoogleLoginClicked) { /* The user has already clicked login so we attempt to resolve all errors until the user is signed in, * or they cancel. */ resolveSignInError(); } else { Log.e(TAG, result.ToString()); } } }
public override void onError(string error) { Log.e(TAG, error); }
public override void onError(string s) { Log.e(outerInstance.TAG, "Could not load video: " + s); }
public virtual void onError(string error) { Log.e(outerInstance.TAG, error); }
public override void onScreenCaptureError(string errorDescription) { Log.e(TAG, "Screen capturer error: " + errorDescription); outerInstance.stopScreenCapture(); Toast.makeText(outerInstance, [email protected]_capture_error, Toast.LENGTH_LONG).show(); }
public override void processEvent(Event @event) { // Log the event and display a warning message (later) Log.e(outerInstance.TAG, @event.Type); // TODO: throw up a stock Android warning widget. }