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;
85 private static final String KEY_DURATION =
"dur";
86 private static final String KEY_WIDTH =
"w";
87 private static final String KEY_HEIGHT =
"h";
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)
void setHeight(int height)
设置视频的高度
NimStorageType storageType()
void save(JSONObject json)
long getDuration()
获取视频的播放时长
void setDuration(long duration)
设置视频的播放时长
void setWidth(int width)
设置视频的宽度
String getThumbUrl()
获取缩略图 thumbUrl
void load(JSONObject json)