Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.2022
Browse files Browse the repository at this point in the history
It is based on:
* psi: b46af0ef
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed Jul 3, 2024
1 parent ae47c0c commit da3cf9c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/filesharingmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ void FileSharingManager::fillMessageView(MessageView &mv, const Message &m, PsiA
// only audio and image supported for now
if (!ms.isValid() || !ms.file.hasComputedHashes() || !ms.file.size().has_value()
|| !(ms.file.mediaType().startsWith(QLatin1String("audio"))
|| ms.file.mediaType().startsWith(QLatin1String("image")))) {
|| ms.file.mediaType().startsWith(QLatin1String("image"))
|| ms.file.mediaType().startsWith(QLatin1String("video")))) {
continue;
}
auto item = new FileSharingItem(ms, m.from(), acc, this);
Expand Down
19 changes: 17 additions & 2 deletions themes/chatview/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,15 @@ function initPsiTheme() {
return range.createContextualFragment(html);
},

videoPreview: function(source) {
const html = `<div class="video psi-preview">
<video width="560" height="315" controls="1">
<source src="${source}"/>
</video>
</div>`;
return chat.util.createHtmlNode(html);
},

replaceYoutube : function(linkEl) {
var baseLink = "https://www.youtube.com/embed/";
var link;
Expand Down Expand Up @@ -686,8 +695,8 @@ function initPsiTheme() {

replaceVideo : function(linkEl)
{
var audio = chat.util.createHtmlNode('<div class="video psi-preview"><video width="560" height="315" controls="1"><source src="'+ linkEl.href +'"></video></div>');
linkEl.parentNode.insertBefore(audio, linkEl.nextSibling);
const video = chat.util.videoPreview(linkEl.href);
linkEl.parentNode.insertBefore(video, linkEl.nextSibling);
},

replaceLinkAsync : function(linkEl)
Expand Down Expand Up @@ -783,6 +792,12 @@ ${info}
share.parentNode.insertBefore(img, share.nextSibling);
else
share.parentNode.appendChild(img);
} else if (type.startsWith("video")) {
player = chat.util.videoPreview(`/psi/account/${session.account}/sharedfile/${source}`);
if (share.nextSibling)
share.parentNode.insertBefore(player, share.nextSibling);
else
share.parentNode.appendChild(player);
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.2021 (2024-07-03, ec259f68)
1.5.2022 (2024-07-04, b46af0ef)

0 comments on commit da3cf9c

Please sign in to comment.