本文整理匯總了Java中com.netease.nimlib.sdk.msg.attachment.VideoAttachment類的典型用法代碼示例。如果您正苦於以下問題:Java VideoAttachment類的具體用法?Java VideoAttachment怎麽用?Java VideoAttachment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
VideoAttachment類屬於com.netease.nimlib.sdk.msg.attachment包,在下文中一共展示了VideoAttachment類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onDownloadSuccess
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; //導入依賴的package包/類
private void onDownloadSuccess(final IMMessage message) {
downloadFuture = null;
downloadLayout.setVisibility(View.GONE);
videoFilePath = ((VideoAttachment) message.getAttachment()).getPath();
surfaceView.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (playState == PLAY_STATE_PAUSE) {
resumeVideo();
} else if (playState == PLAY_STATE_PLAYING) {
pauseVideo();
} else if (playState == PLAY_STATE_STOP) {
playVideo();
}
}
});
playVideo();
}
示例2: showVideoInfo
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; //導入依賴的package包/類
/**
* **************************** 下載視頻 *********************************
*/
private void showVideoInfo() {
long duration = ((VideoAttachment) message.getAttachment()).getDuration();
long fileSize = ((VideoAttachment) message.getAttachment()).getSize();
if (duration <= 0) {
fileInfoTextView.setText("大小: " + FileUtil.formatFileSize(fileSize));
} else {
long seconds = TimeUtil.getSecondsByMilliseconds(duration);
fileInfoTextView.setText("大小: " + FileUtil.formatFileSize(fileSize) + ",時長: "
+ String.valueOf(seconds) + " 秒");
videoLength = seconds;
}
}
示例3: isVideoHasDownloaded
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; //導入依賴的package包/類
private boolean isVideoHasDownloaded(final IMMessage message) {
if (message.getAttachStatus() == AttachStatusEnum.transferred &&
!TextUtils.isEmpty(((VideoAttachment) message.getAttachment()).getPath())) {
return true;
}
return false;
}
示例4: thumbFromSourceFile
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; //導入依賴的package包/類
@Override
protected String thumbFromSourceFile(String path) {
VideoAttachment attachment = (VideoAttachment) message.getAttachment();
String thumb = attachment.getThumbPathForSave();
return BitmapDecoder.extractThumbnail(path, thumb) ? thumb : null;
}
示例5: onDownloadStart
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; //導入依賴的package包/類
private void onDownloadStart(IMMessage message) {
setDownloadProgress(getString(R.string.download_video), 0, ((VideoAttachment) message.getAttachment()).getSize());
downloadLayout.setVisibility(View.VISIBLE);
}