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


Java VideoAttachment类代码示例

本文整理汇总了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();
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:21,代码来源:WatchVideoActivity.java

示例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;
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:17,代码来源:WatchVideoActivity.java

示例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;
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:9,代码来源:WatchVideoActivity.java

示例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;
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:7,代码来源:MsgViewHolderVideo.java

示例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);
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:5,代码来源:WatchVideoActivity.java


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