我的未上市(不是私人,只是未列出!)视频无法播放。设置了PlayerStateChangeListener,显示视频由于INTERNAL_ERROR
而无法播放:
YouTubePlayerSupportFragment fragment = YouTubePlayerSupportFragment.newInstance();
getChildFragmentManager()
.beginTransaction()
.add(R.id.video, fragment)
.commit();
fragment.initialize(DEVELOPER_KEY, new YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
youTubePlayer.loadVideo(videoIDForVideoMedia(MY_VIDEO_ID));
youTubePlayer.setPlayerStateChangeListener(new YouTubePlayer.PlayerStateChangeListener() {
@Override
public void onLoading() {}
@Override
public void onLoaded(String s) {}
@Override
public void onAdStarted() {}
@Override
public void onVideoStarted() {}
@Override
public void onVideoEnded() {}
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
Log.e(TAG, errorReason.toString()); // INTERNAL_ERROR right after the video loaded
}
});
// etc...
可以找到有关错误的更多信息here。
到目前为止,我为MY_VIDEO_ID
设置的所有公开视频ID都没有任何问题。有没有人成功播放过不公开的视频?