瀏覽代碼

Deleolajide m4a webm support (#1217)

* Add support for webm video and m4a audio media files
* updated CHANGES.md
Dele Olajide 6 年之前
父節點
當前提交
647f7cf302
共有 2 個文件被更改,包括 8 次插入3 次删除
  1. 4 0
      CHANGES.md
  2. 4 3
      src/utils/core.js

+ 4 - 0
CHANGES.md

@@ -1,5 +1,9 @@
 # Changelog
 
+## 4.0.2 (2018-??-??)
+
+- M4A and WEBM files when sent as XEP-0066 Out of Band Data, are now playable directly in chat
+
 ## 4.0.1 (2018-09-19)
 
 - Use https://compliance.conversations.im instead of (dead) https://xmpp.net

+ 4 - 3
src/utils/core.js

@@ -314,6 +314,7 @@
             lower_filename.endsWith('mp3') || lower_filename.endsWith('mp4') ||
             lower_filename.endsWith('jpg') || lower_filename.endsWith('jpeg') ||
             lower_filename.endsWith('png') || lower_filename.endsWith('gif') ||
+            lower_filename.endsWith('m4a') || lower_filename.endsWith('webm') ||
             lower_filename.endsWith('svg')) {
 
             return url;
@@ -341,7 +342,7 @@
 
     u.renderMovieURL = function (_converse, url) {
         const { __ } = _converse;
-        if (url.endsWith('mp4')) {
+        if (url.endsWith('mp4') || url.endsWith('webm')) {
             return tpl_video({
                 'url': url,
                 'label_download': __('Download video file')
@@ -352,7 +353,7 @@
 
     u.renderAudioURL = function (_converse, url) {
         const { __ } = _converse;
-        if (url.endsWith('mp3')) {
+        if (url.endsWith('mp3') || url.endsWith('m4a')) {
             return tpl_audio({
                 'url': url,
                 'label_download': __('Download audio file')
@@ -471,7 +472,7 @@
 
             el.style.overflow = 'hidden';
 
-            function draw () { 
+            function draw () {
                 height -= original_height/steps;
                 if (height > 0) {
                     el.style.height = height + 'px';