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:
28
viewfeed.js
28
viewfeed.js
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user