mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:25:59 +00:00
remove js-based player, better mp3 support detection for html5 audio
This commit is contained in:
@@ -248,11 +248,15 @@ function init() {
|
||||
|
||||
loading_set_progress(20);
|
||||
|
||||
var hasAudio = !!((myAudioTag = document.createElement('audio')).canPlayType);
|
||||
var a = document.createElement('audio');
|
||||
|
||||
var hasAudio = !!a.canPlayType;
|
||||
var hasSandbox = "sandbox" in document.createElement("iframe");
|
||||
var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
|
||||
hasMp3: hasMp3,
|
||||
hasSandbox: hasSandbox},
|
||||
onComplete: function(transport) {
|
||||
backend_sanity_check_callback(transport);
|
||||
|
||||
@@ -2027,34 +2027,6 @@ function initHeadlinesMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function player(elem) {
|
||||
var aid = elem.getAttribute("audio-id");
|
||||
var status = elem.getAttribute("status");
|
||||
|
||||
var audio = $(aid);
|
||||
|
||||
if (audio) {
|
||||
if (status == 0) {
|
||||
audio.play();
|
||||
status = 1;
|
||||
elem.innerHTML = __("Playing...");
|
||||
elem.title = __("Click to pause");
|
||||
elem.addClassName("playing");
|
||||
} else {
|
||||
audio.pause();
|
||||
status = 0;
|
||||
elem.innerHTML = __("Play");
|
||||
elem.title = __("Click to play");
|
||||
elem.removeClassName("playing");
|
||||
}
|
||||
|
||||
elem.setAttribute("status", status);
|
||||
} else {
|
||||
alert("Your browser doesn't seem to support HTML5 audio.");
|
||||
}
|
||||
}
|
||||
|
||||
function cache_set(id, obj) {
|
||||
//console.log("cache_set: " + id);
|
||||
if (has_storage)
|
||||
|
||||
Reference in New Issue
Block a user