Commit 2acf2dbc authored by yPhil's avatar yPhil
Browse files

Player OK in Chrome & bonkers in Mozilla (ogg&mp3)

parent a9c9c9b6
Pipeline #394229 passed with stage
in 47 seconds
......@@ -25,7 +25,8 @@
"remotestorage": "rs#1.1.0",
"rs-widget": "1.3.0",
"DOMPurify": "dompurify#^2.2.6",
"responsively-lazy": "^2.0.2"
"responsively-lazy": "^2.0.2",
"slim-scroll": "^1.3.3"
},
"resolutions": {
"intro.js": "^3.3.1"
......
......@@ -1425,7 +1425,6 @@ div#logo-title > .logo-title > a:hover {
/* margin-top: 0; */
/* } */
#notify {
background-color: var(--color-ui-qua);
border: 1px solid var(--color-ui-sec);
......@@ -1440,3 +1439,31 @@ div#logo-title > .logo-title > a:hover {
z-index: 30;
/* flex-direction: column; */
}
* {
scrollbar-width: thin;
scrollbar-color: var(--color-ui-pri) var(--color-ui-qua);
}
/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
width: 12px;
}
*::-webkit-scrollbar-track {
background: var(--color-ui-qua);
}
*::-webkit-scrollbar-thumb {
background-color: var(--color-ui-pri);
border-radius: 20px;
border: 3px solid var(--color-ui-qua);
}
audio {
border-radius: 0;
width: 100%;
height: 32px;
background-color: var(--color-ui-pri);
box-shadow: 5px 5px 20px rgba(0,0, 0, 0.4);
}
......@@ -301,7 +301,7 @@ PTL.feed = {
$.each(data.feedItems, function(index, item) {
// if (index == parseInt(feedLimit)) return false;
if (index == 30) return false;
// console.log('i: (%s)', JSON.stringify(item));
......@@ -396,23 +396,38 @@ PTL.feed = {
imageUrl = item.enclosures[0].url;
}
if (item.enclosures[0].url.match(/\.(ogg|mp3|mp4)$/)) {
console.log('JSON.stringify(item.enclosures): %s (%s)', JSON.stringify(item.enclosures));
var soundPlayer = document.createElement('audio');
soundPlayer.id = 'audio-player';
soundPlayer.controls = 'controls';
soundPlayer.src = item.enclosures[0].url;
soundPlayer.type = 'audio/mpeg';
if (item.enclosures[0].url && item.enclosures[0].url.match(/\.(ogg|mp3)$/)) {
if (item.enclosures[0].url.match(/\.(ogg)$/)) {
console.log('ogg!: %s (%s)');
soundPlayer.type = 'application/ogg';
} else {
console.log('mpeg!: %s (%s)');
soundPlayer.type = 'audio/mpeg';
}
var audioPlayer = document.createElement('audio');
audioPlayer.id = 'audio-player';
audioPlayer.controls = 'controls';
audioPlayer.src = item.enclosures[0].url;
audioPlayer.type = item.enclosures[0].type;
// var $audioPlayer = $('<div>');
// $audioPlayer.html('<audio id="audio-player" controls="controls" src="' + item.enclosures[0].url + '" type="audio/ogg">');
// console.log('audio/mp3: %s (%s)', MediaSource.isTypeSupported('video/mp4'));
// console.log('item.enclosures: %s (%s)', JSON.stringify(item.enclosures[0].type), JSON.stringify(item.enclosures[0].url));
// if (JSON.stringify(item.enclosures[0].type) === 'audio/mpeg') {
// console.log('plop!: %s (%s)');
// }
// if (item.enclosures[0].url.match(/\.(ogg)$/)) {
// console.log('ogg!: %s (%s)');
// soundPlayer.type = 'application/ogg';
// } else {
// console.log('mpeg!: %s (%s)');
// soundPlayer.type = 'audio/mpeg';
// }
$itemDiv.append(soundPlayer);
// $itemDiv.append($audioPlayer);
$itemDiv.append(audioPlayer);
$soundLink
.attr('href', item.enclosures[0].url)
......
......@@ -513,6 +513,6 @@
</button>
</div>
<script async src=" /bower/responsively-lazy/responsivelyLazy.min.js"></script>
<script async src="/bower/responsively-lazy/responsivelyLazy.min.js"></script>
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment