private void initVideoView(final int paramInt, final FeedViewHolder paramFeedViewHolder) { paramFeedViewHolder.videoLoadImage.setVisibility(4); final SdkVideoView localSdkVideoView = paramFeedViewHolder.videoView; localSdkVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { public void onPrepared(MediaPlayer paramAnonymousMediaPlayer) { if (localSdkVideoView.getPlayingPosition() == FeedAdapter.this.mCurrentPlaying) paramAnonymousMediaPlayer.start(); while (true) { FeedAdapter.this.endLoadingTimeProfiling(); paramFeedViewHolder.videoView.setVisibility(0); return; SLog.e("This video should not be played: {}, {}.", Integer.valueOf(localSdkVideoView.getPlayingPosition()), Integer.valueOf(FeedAdapter.this.mCurrentPlaying)); } } }); localSdkVideoView.setOnErrorListener(new MediaPlayer.OnErrorListener() { public boolean onError(MediaPlayer paramAnonymousMediaPlayer, int paramAnonymousInt1, int paramAnonymousInt2) { SLog.d("Got error, try recycling it more aggressively: {}, {}", Integer.valueOf(paramAnonymousInt1), Integer.valueOf(paramAnonymousInt2)); FeedAdapter.access$102(FeedAdapter.this, -1 + FeedAdapter.this.currentPlayerCount); FeedAdapter.access$302(FeedAdapter.this, true); FeedAdapter.this.releaseOtherPlayers(localSdkVideoView); if (!localSdkVideoView.retryOpenVideo(false)) { SLog.e("Replay video using videoLowUrl."); FeedAdapter.this.mPaths.remove(paramInt); if ((paramFeedViewHolder.post != null) && (paramFeedViewHolder.post.videoLowURL != null)) { paramFeedViewHolder.post.videoUrl = paramFeedViewHolder.post.videoLowURL; paramFeedViewHolder.post.videoLowURL = null; localSdkVideoView.setReportOpenError(true); if (FeedAdapter.this.mCurrentPlaying == paramInt) FeedAdapter.this.stopCurrentPlayer(); FeedAdapter.this.play(paramInt); } } return true; } }); localSdkVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { public void onCompletion(MediaPlayer paramAnonymousMediaPlayer) { paramAnonymousMediaPlayer.seekTo(0); paramAnonymousMediaPlayer.start(); VinePost localVinePost = (VinePost)FeedAdapter.this.mPosts.get(FeedAdapter.this.mCurrentPlaying); if (localVinePost != null) { long l = localVinePost.postId; LoopManager.get(FeedAdapter.this.mContext).increment(l); } } }); this.mPlayers.put(paramInt, localSdkVideoView); }
public void toggleMute(boolean paramBoolean) { this.mMuted = paramBoolean; SLog.d("Mute state changed to muted? {}.", Boolean.valueOf(paramBoolean)); SdkVideoView localSdkVideoView = getLastPlayer(); if (localSdkVideoView != null) localSdkVideoView.setMute(this.mMuted); }
public void playFile(int paramInt) { int i = 1; if (paramInt < 0); FeedViewHolder localFeedViewHolder; SdkVideoView localSdkVideoView; String str; while (true) { return; View localView; try { SLog.i("Playing item: {}", Integer.valueOf(paramInt)); localView = getViewAtPosition(paramInt); if (localView == null) { SLog.i("Item is not visible: {}", Integer.valueOf(paramInt)); continue; } } finally { } localFeedViewHolder = (FeedViewHolder)localView.getTag(); if (localFeedViewHolder != null) if ((!localFeedViewHolder.isVideoImageLoaded) && (localFeedViewHolder.hasVideoImage)) { SLog.i("Waiting for video image to load: {}.", localFeedViewHolder.videoImageKey.url); bindVideoImage(localFeedViewHolder); bindAvatar(localFeedViewHolder); playCurrentPosition(); } else { localSdkVideoView = localFeedViewHolder.videoView; if (localSdkVideoView != this.mLastPlayer) { SLog.i("Pause previous player."); pauseCurrentPlayer(); } str = (String)this.mPaths.get(paramInt); if (str != null) break; SLog.i("Path was cleared."); } } if (!localSdkVideoView.isPathPlaying(str)) if (SystemUtil.isSinglePlayerEnabled(this.mContext)) if (SdkVideoView.getCurrentUri() != null) break label509; while (true) { label194: if (i == 0) refreshVideoView(paramInt, localFeedViewHolder); localSdkVideoView = localFeedViewHolder.videoView; localSdkVideoView.setMute(this.mMuted); if ((this.mNeedReleaseOtherPlayers) && (this.currentPlayerCount >= this.maxPlayer)) releaseOtherPlayers(localFeedViewHolder.videoView); SLog.i("Start playing by set path."); localSdkVideoView.setTag(Long.valueOf(localFeedViewHolder.post.postId)); Object[] arrayOfObject2 = new Object[1]; arrayOfObject2[0] = Long.valueOf(localFeedViewHolder.post.postId); CrashUtil.log("Setting video path in feed for post {}", arrayOfObject2); localSdkVideoView.setVideoPath(str); if ((!localSdkVideoView.isSurfaceReady()) && (localSdkVideoView.getVisibility() != 0)) localSdkVideoView.setVisibility(0); this.currentPlayerCount = (1 + this.currentPlayerCount); while (true) { localSdkVideoView.setPlayingPosition(paramInt); localFeedViewHolder.listener.setPosition(paramInt); if (localFeedViewHolder.imageListener != null) localFeedViewHolder.imageListener.setPosition(paramInt); this.mCurrentPlaying = paramInt; this.mLastPlayer = localSdkVideoView; break; if (localSdkVideoView.getPath() == null) break label194; i = 0; break label194; if (localFeedViewHolder.videoView.getVisibility() != 0) localFeedViewHolder.videoView.setVisibility(0); localSdkVideoView.setMute(this.mMuted); if (localSdkVideoView.isInPlaybackState()) { SLog.i("Start playing by calling start."); localSdkVideoView.start(); } else { SLog.i("Start playing by set path."); localSdkVideoView.setTag(Long.valueOf(localFeedViewHolder.post.postId)); Object[] arrayOfObject1 = new Object[1]; arrayOfObject1[0] = Long.valueOf(localFeedViewHolder.post.postId); CrashUtil.log("Setting video path in feed for post {}", arrayOfObject1); localSdkVideoView.setVideoPath(str); } } label509: i = 0; } }