当前位置: 首页>>代码示例>>Java>>正文


Java YouTubeInitializationResult.isUserRecoverableError方法代码示例

本文整理汇总了Java中com.google.android.youtube.player.YouTubeInitializationResult.isUserRecoverableError方法的典型用法代码示例。如果您正苦于以下问题:Java YouTubeInitializationResult.isUserRecoverableError方法的具体用法?Java YouTubeInitializationResult.isUserRecoverableError怎么用?Java YouTubeInitializationResult.isUserRecoverableError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.youtube.player.YouTubeInitializationResult的用法示例。


在下文中一共展示了YouTubeInitializationResult.isUserRecoverableError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  switch (requestCode) {
    // called when playing a movie, could fail and this dialog shows the user how to fix it
    case YouTubeAPI.REQ_PLAYER_CODE:
      if (resultCode != RESULT_OK) {
        YouTubeInitializationResult errorReason = YouTubeStandalonePlayer.getReturnedInitializationResult(data);
        if (errorReason.isUserRecoverableError()) {
          errorReason.getErrorDialog(this, 0).show();
        } else {
          String errorMessage = String.format("PLAYER ERROR!! - %s", errorReason.toString());
          Utils.toast(this, errorMessage);
        }
      }

      break;
    default:
      super.onActivityResult(requestCode, resultCode, data);
  }
}
 
开发者ID:sgehrman,项目名称:UTubeTV,代码行数:21,代码来源:DrawerActivity.java

示例2: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        LogSaver.appendLog(TAG+" :"+youTubeInitializationResult.toString());
        youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
    } else {
        String errorMessage = String.format(
                getString(R.string.error_player), youTubeInitializationResult.toString());
        Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:rishabh115,项目名称:Odyssey2017,代码行数:12,代码来源:YoutubeActivity.java

示例3: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
        YouTubeInitializationResult errorReason =
                YouTubeStandalonePlayer.getReturnedInitializationResult(data);
        if (errorReason.isUserRecoverableError()) {
            errorReason.getErrorDialog(this, 0).show();
        } else {
            String errorMessage =
                    String.format(getString(R.string.error_player), errorReason.toString());
            Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:16,代码来源:OverviewActivity.java

示例4: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
                                    YouTubeInitializationResult errorReason) {
    if (errorReason.isUserRecoverableError()) {
        errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
    } else {
        String errorMessage = String.format(getString(R.string.error_player), errorReason.toString());
        Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:DameMatiku,项目名称:damematiku-android,代码行数:11,代码来源:YouTubeFailureRecoveryActivity.java

示例5: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        //Handle the failure
        Toast.makeText(getActivity(), "onInitializationFailure", Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:10,代码来源:Fragment2.java

示例6: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorReason) {
    if (errorReason.isUserRecoverableError()) {
        errorReason.getErrorDialog(this, RECOVERY_REQUEST).show();
    } else {
        String error = String.format("player error!", errorReason.toString());
        Toast.makeText(this, error, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:applicaster,项目名称:rn-youtube-android,代码行数:10,代码来源:YoutubePlayerActivity.java

示例7: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
                                    YouTubeInitializationResult errorReason) {
    if (errorReason.isUserRecoverableError()) {
        errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
    } else {
        String errorMessage = String.format(
                "There was an error initializing the YouTubePlayer (%1$s)",
                errorReason.toString());
        Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:SEA2015-GROUP7,项目名称:projectTetViet,代码行数:13,代码来源:YouTubePlayerActivity.java

示例8: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        Toast.makeText(getActivity(), "The Youtube Player could'nt be initialized", Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:muddassir235,项目名称:Pop-Movies-Android-App,代码行数:9,代码来源:YoutubeFailureRecoveryFragment.java

示例9: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        if (isAdded()) {
            Toast.makeText(getActivity().getApplicationContext(), getString(R.string.error_init_failure_msg), Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:ganesh2shiv,项目名称:yt-channel-list-android,代码行数:11,代码来源:YoutubePlayerFragment.java

示例10: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
    YouTubeInitializationResult errorReason =
        YouTubeStandalonePlayer.getReturnedInitializationResult(data);
    if (errorReason.isUserRecoverableError()) {
      errorReason.getErrorDialog(this, 0).show();
    } else {
      String errorMessage =
          String.format(getString(R.string.error_player), errorReason.toString());
      Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:16,代码来源:StandalonePlayerDemoActivity.java

示例11: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(
    YouTubeThumbnailView thumbnailView, YouTubeInitializationResult errorReason) {
  if (errorReason.isUserRecoverableError()) {
    if (errorDialog == null || !errorDialog.isShowing()) {
      errorDialog = errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST);
      errorDialog.show();
    }
  } else {
    String errorMessage =
        String.format(getString(R.string.error_thumbnail_view), errorReason.toString());
    Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:15,代码来源:VideoWallDemoActivity.java

示例12: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
    YouTubeInitializationResult errorReason) {
  if (errorReason.isUserRecoverableError()) {
    errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
  } else {
    String errorMessage = String.format(getString(R.string.error_player), errorReason.toString());
    Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:YouTubeFailureRecoveryActivity.java

示例13: checkYouTubeApi

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
private void checkYouTubeApi() {
  YouTubeInitializationResult errorReason =
      YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(this);
  if (errorReason.isUserRecoverableError()) {
    errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
  } else if (errorReason != YouTubeInitializationResult.SUCCESS) {
    String errorMessage =
        String.format(getString(R.string.error_player), errorReason.toString());
    Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:12,代码来源:VideoListDemoActivity.java

示例14: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
    if (errorResult.isUserRecoverableError()) {
        errorResult.getErrorDialog(getActivity(), RECOVERY_REQUEST).show();
    } else {
        String error = String.format(getString(R.string.player_error), errorResult.toString());
        Toast.makeText(getActivity(), error, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:JimSeker,项目名称:AudioVideo,代码行数:10,代码来源:MainFragment.java

示例15: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //导入方法依赖的package包/类
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
    if (errorResult.isUserRecoverableError()) {
        errorResult.getErrorDialog(this, RECOVERY_REQUEST).show();
    } else {
        String error = String.format(getString(R.string.player_error), errorResult.toString());
        Toast.makeText(this, error, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:JimSeker,项目名称:AudioVideo,代码行数:10,代码来源:BasicYTActivity.java


注:本文中的com.google.android.youtube.player.YouTubeInitializationResult.isUserRecoverableError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。