恢复视频的发布
This commit is contained in:
@@ -180,9 +180,9 @@
|
||||
this.$refs.customEditor.clear();
|
||||
}
|
||||
let method = IMMethods.SendMessage;
|
||||
if([MessageType.PictureMessage,MessageType.VoiceMessage,MessageType.VideoMessage,MessageType.FileMessage].includes(message.contentType)){
|
||||
method = IMMethods.SendMessageNotOss;
|
||||
}
|
||||
// if([MessageType.PictureMessage,MessageType.VoiceMessage,MessageType.VideoMessage,MessageType.FileMessage].includes(message.contentType)){
|
||||
// method = IMMethods.SendMessageNotOss;
|
||||
// }
|
||||
this.$emit("scrollToBottom");
|
||||
IMSDK.asyncApi(method, IMSDK.uuid(), {
|
||||
recvID: user_id,
|
||||
@@ -271,16 +271,8 @@
|
||||
},
|
||||
async sendVoiceMessage(audio){
|
||||
const _this = this;
|
||||
const message = await IMSDK.asyncApi(
|
||||
IMMethods.CreateSoundMessageFromFullPath,
|
||||
IMSDK.uuid(),
|
||||
{
|
||||
soundPath:getPurePath(audio.tempFilePath),
|
||||
duration:audio.contentDuration
|
||||
}
|
||||
);
|
||||
const message = await IM.createVoiceMessage(audio.tempFilePath,audio.contentDuration);
|
||||
_this.sendMessage(message,_this.storeCurrentConversation.userID,_this.storeCurrentConversation.groupID);
|
||||
|
||||
},
|
||||
// from comp
|
||||
sendMediaMesage(paths) {
|
||||
@@ -290,8 +282,10 @@
|
||||
try {
|
||||
let message = null;
|
||||
if(item.search('.mp4')>0){
|
||||
console.log('1');
|
||||
message = await IM.createVideoMessage(item);
|
||||
}else{
|
||||
console.log('2');
|
||||
message = await IM.createImageMessage(item);
|
||||
}
|
||||
console.log(message);
|
||||
@@ -335,7 +329,7 @@
|
||||
const _this = this;
|
||||
if(e.type=="atevent" && this.storeCurrentConversation.groupID){
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/contactChoose/chooseGroupMember?groupID=${this.storeCurrentConversation.groupID}&checkedUserIDList=[]&hideUserIDList=[${this.storeCurrentUserID}]`,
|
||||
url: `/pages/common/contactChoose/chooseGroupMember?groupID=${this.storeCurrentConversation.groupID}&checkedUserIDList=[]&hideUserIDList=[${this.storeCurrentUserID}]&allowType=User`,
|
||||
events: {
|
||||
onSelectedConfirm(userList) {
|
||||
userList.forEach((user)=>{
|
||||
@@ -398,8 +392,7 @@
|
||||
//crop:null,
|
||||
editable:true,
|
||||
filename:"_doc/",
|
||||
//filter:"none",//image,none,video
|
||||
filter:"image",
|
||||
filter:"none",//image,none,video
|
||||
maximum:9,
|
||||
multiple:true,
|
||||
permissionAlert:true,
|
||||
|
||||
@@ -51,11 +51,6 @@
|
||||
return 120 * aspectRatio;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
src(newVal, oldVal) {
|
||||
console.log(newVal,oldVal);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
@@ -63,18 +58,38 @@
|
||||
async init(){
|
||||
const self = this;
|
||||
let url = "";
|
||||
const pictureElem = this.message.pictureElem;
|
||||
// 如果有远程 snapshotUrl,则下载到 coverCachePath
|
||||
//const snapshotUrl = (this.message.pictureElem.snapshotPicture?.url ?? this.message.pictureElem.sourcePath );
|
||||
const snapshotUrl = this.message.pictureElem.sourcePicture?.url;
|
||||
let snapshotUrl = pictureElem?.sourcePath;
|
||||
if(snapshotUrl && await util.fileExsit(snapshotUrl)){
|
||||
self.src = snapshotUrl;
|
||||
return ;
|
||||
}
|
||||
|
||||
snapshotUrl = (pictureElem?.sourcePicture.url ?? pictureElem.bigPicture?.url);
|
||||
if(!snapshotUrl){
|
||||
console.log(this.message);
|
||||
return;
|
||||
}
|
||||
//console.log(snapshotUrl);
|
||||
console.log(snapshotUrl);
|
||||
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
|
||||
self.coverDownloading = false;
|
||||
self.src = fn;
|
||||
//console.log(fn);
|
||||
console.log(fn);
|
||||
});
|
||||
},
|
||||
getShowPath(url){
|
||||
return new Promise((resolve,reject)=>{
|
||||
if(url.startsWith('file')||url.startsWith('_')||url.startsWith('http')||url.startsWith('blob')){
|
||||
return resolve(url);
|
||||
}
|
||||
plus.io.resolveLocalFileSystemURL(url, function(entry) {
|
||||
return resolve(entry.toLocalURL());
|
||||
}, function(e) {
|
||||
console.log(e);
|
||||
resolve(url);
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
clickMediaItem() {
|
||||
|
||||
Reference in New Issue
Block a user