1 package com.netease.nimlib.sdk.msg.attachment;
7 import org.json.JSONObject;
18 private long duration;
69 this.duration = duration;
77 return MsgHelper.getThumbUrl(
this,
getUrl());
82 return NimStorageType.TYPE_VIDEO;
90 protected void save(JSONObject json) {
91 JSONHelper.put(json, KEY_WIDTH, width);
92 JSONHelper.put(json, KEY_HEIGHT, height);
93 JSONHelper.put(json, KEY_DURATION, duration);
97 protected void load(JSONObject json) {
98 width = JSONHelper.getInt(json, KEY_WIDTH);
99 height = JSONHelper.getInt(json, KEY_HEIGHT);
100 duration = JSONHelper.getInt(json, KEY_DURATION);
String getUrl()
获取文件在服务器上的下载url。若文件还未上传,返回null
VideoAttachment(String attach)
static final String KEY_DURATION
void setHeight(int height)
设置视频的高度
NimStorageType storageType()
void save(JSONObject json)
long getDuration()
获取视频的播放时长
static final String KEY_WIDTH
void setDuration(long duration)
设置视频的播放时长
static final String KEY_HEIGHT
void setWidth(int width)
设置视频的宽度
String getThumbUrl()
获取缩略图 thumbUrl
void load(JSONObject json)