當前位置: 首頁>>代碼示例>>Java>>正文


Java MediaProjection.Callback方法代碼示例

本文整理匯總了Java中android.media.projection.MediaProjection.Callback方法的典型用法代碼示例。如果您正苦於以下問題:Java MediaProjection.Callback方法的具體用法?Java MediaProjection.Callback怎麽用?Java MediaProjection.Callback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.media.projection.MediaProjection的用法示例。


在下文中一共展示了MediaProjection.Callback方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createScreenCapturer

import android.media.projection.MediaProjection; //導入方法依賴的package包/類
@TargetApi(21)
private VideoCapturer createScreenCapturer() {
  if (mediaProjectionPermissionResultCode != Activity.RESULT_OK) {
    reportError("User didn't give permission to capture the screen.");
    return null;
  }
  return new ScreenCapturerAndroid(
      mediaProjectionPermissionResultData, new MediaProjection.Callback() {
    @Override
    public void onStop() {
      reportError("User revoked permission to capture the screen.");
    }
  });
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:15,代碼來源:CallActivity.java

示例2: createScreenCapturer

import android.media.projection.MediaProjection; //導入方法依賴的package包/類
@TargetApi(21)
private VideoCapturer createScreenCapturer() {
    if (mediaProjectionPermissionResultCode != Activity.RESULT_OK) {
        reportError("User didn't give permission to capture the screen.");
        return null;
    }
    return new ScreenCapturerAndroid(
            mediaProjectionPermissionResultData, new MediaProjection.Callback() {
        @Override
        public void onStop() {
            reportError("User revoked permission to capture the screen.");
        }
    });
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:15,代碼來源:CallActivity.java

示例3: ScreenCapturerAndroid

import android.media.projection.MediaProjection; //導入方法依賴的package包/類
/**
 * Constructs a new Screen Capturer.
 *
 * @param mediaProjectionPermissionResultData the result data of MediaProjection permission
 *     activity; the calling app must validate that result code is Activity.RESULT_OK before
 *     calling this method.
 * @param mediaProjectionCallback MediaProjection callback to implement application specific
 *     logic in events such as when the user revokes a previously granted capture permission.
**/
public ScreenCapturerAndroid(Intent mediaProjectionPermissionResultData,
    MediaProjection.Callback mediaProjectionCallback) {
  this.mediaProjectionPermissionResultData = mediaProjectionPermissionResultData;
  this.mediaProjectionCallback = mediaProjectionCallback;
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:15,代碼來源:ScreenCapturerAndroid.java


注:本文中的android.media.projection.MediaProjection.Callback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。