當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。