]> cat aescling's git repositories - mastodon.git/commitdiff
Suppress type error(not a function) on calling fastSeek (#5452)
authorSho Kusano <rosylilly@aduca.org>
Wed, 18 Oct 2017 15:13:51 +0000 (00:13 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 18 Oct 2017 15:13:51 +0000 (17:13 +0200)
app/javascript/mastodon/middleware/sounds.js

index 372e7c8354dcad0723fc9571ff461d7aa9e55a90..3d1e3eabaa0fefb43fcb418611a994c31e54c33c 100644 (file)
@@ -12,7 +12,11 @@ const createAudio = sources => {
 const play = audio => {
   if (!audio.paused) {
     audio.pause();
-    audio.fastSeek(0);
+    if (typeof audio.fastSeek === 'function') {
+      audio.fastSeek(0);
+    } else {
+      audio.seek(0);
+    }
   }
 
   audio.play();