本文整理汇总了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);
}