summaryrefslogtreecommitdiff
path: root/js/App.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-15 14:10:46 +0300
committerAndrew Dolgov <[email protected]>2021-02-15 14:10:46 +0300
commit82adb01307e108e8a2b4eeb900552160d730d0b7 (patch)
tree1048a18b3ad79a546e847ca52267249b6ab3b073 /js/App.js
parent916c21fe60490c50e9ae587b0a977302b9110800 (diff)
render enclosures on the client
Diffstat (limited to 'js/App.js')
-rw-r--r--js/App.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/js/App.js b/js/App.js
index 0a72d1b12..3a31438c5 100644
--- a/js/App.js
+++ b/js/App.js
@@ -586,6 +586,10 @@ const App = {
isPrefs() {
return this.is_prefs;
},
+ audioCanPlay: function(ctype) {
+ const a = document.createElement('audio');
+ return a.canPlayType(ctype);
+ },
init: function(parser, is_prefs) {
this.is_prefs = is_prefs;
window.onerror = this.Error.onWindowError;
@@ -604,17 +608,11 @@ const App = {
this.initHotkeyActions();
this.enableCsrfSupport();
- const a = document.createElement('audio');
- const hasAudio = !!a.canPlayType;
- const hasSandbox = "sandbox" in document.createElement("iframe");
- const hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
- const clientTzOffset = new Date().getTimezoneOffset() * 60;
-
const params = {
- op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
- hasMp3: hasMp3,
- clientTzOffset: clientTzOffset,
- hasSandbox: hasSandbox
+ op: "rpc",
+ method: "sanityCheck",
+ clientTzOffset: new Date().getTimezoneOffset() * 60,
+ hasSandbox: "sandbox" in document.createElement("iframe")
};
xhrPost("backend.php", params, (transport) => {