1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 22:45:56 +00:00

use html5 audio player instead of flash when possible

This commit is contained in:
Andrew Dolgov
2010-11-30 12:40:23 +03:00
parent d769a0f75a
commit c3edc667f1
5 changed files with 88 additions and 10 deletions

View File

@@ -2365,3 +2365,31 @@ function editArticleNote(id) {
exception_error("editArticleNote", e);
}
}
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.");
}
}