mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
JavaScript string compare '' is always a ToBoolean
See https://www.ecma-international.org/ecma-262/5.1/#sec-9.2
This commit is contained in:
parent
82bed1ed80
commit
2ba34532c2
57 changed files with 213 additions and 218 deletions
|
|
@ -19,9 +19,9 @@ class Audio {
|
|||
|
||||
this.supported = !bMobileDevice && !bSafari && !!this.player && !!this.player.play;
|
||||
if (this.supported && this.player && this.player.canPlayType) {
|
||||
this.supportedMp3 = '' !== this.player.canPlayType('audio/mpeg;').replace(/no/, '');
|
||||
this.supportedWav = '' !== this.player.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
|
||||
this.supportedOgg = '' !== this.player.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
|
||||
this.supportedMp3 = !!this.player.canPlayType('audio/mpeg;').replace(/no/, '');
|
||||
this.supportedWav = !!this.player.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
|
||||
this.supportedOgg = !!this.player.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
|
||||
this.supportedNotification = this.supported && this.supportedMp3;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ class Audio {
|
|||
name = trim(name.substr(0, name.length - 4));
|
||||
}
|
||||
|
||||
return '' === name ? 'audio' : name;
|
||||
return name || 'audio';
|
||||
}
|
||||
|
||||
playMp3(url, name) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue