02-16-2020, 01:26 PM
sorry if i am not clear, i am gonna try to re-phrase it better now.
After successfully trying the stream option in moode audio, I want to stream my music on a webpage that also show the name of the track as well as play the music.
So I write this little html like below :
<body class="clearfix">
<audio loop autoplay name="media"><source src="http://myip:mystreamport" type="audio/flac"></audio>
<div id="song"></div>
</body>
then in order to show the name of the song, I activated last.fm option and then with this little javascript I update it every 15sec.
//every 15sec
window.setInterval(function(){
fetch('https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=myuser&api_key=myapikey&format=json')
.then(function (response) {
return response.json();
})
.then(function (data) {
appendData(data);
})
.catch(function (err) {
console.log('error: ' + err);
});
}, 15000);//every 15sec
function appendData(data) {
var song = document.getElementById("song");
song.innerHTML = "'"+data.recenttracks.track[0].name+"' in '"+data.recenttracks.track[0].album["#text"]+"' by '"+data.recenttracks.track[0].artist["#text"]+"'";
}
then I got that warning "Mixed Content: The page at 'https://mylittleradio.com/' was loaded over HTTPS, but requested an insecure audio file 'http://myip:myport/'. This content should also be served over HTTPS."
This is a warning but very soon will be blocking since the web is moving forward to be more secure with https by default everywhere nowadays.
So this is my question, is there a way to configure nginx in order to add ssl certificate configuration to my stream url ?
I also looked about icecast2 that does that but I am really keen on mixing to many software together when nginx is already there and shall be able to do the job.
Hope it is more clear and making sense.
Please don't hesitate to ask me specific details if I can provide to bring more clarity to my problematic.
thanks !
After successfully trying the stream option in moode audio, I want to stream my music on a webpage that also show the name of the track as well as play the music.
So I write this little html like below :
<body class="clearfix">
<audio loop autoplay name="media"><source src="http://myip:mystreamport" type="audio/flac"></audio>
<div id="song"></div>
</body>
then in order to show the name of the song, I activated last.fm option and then with this little javascript I update it every 15sec.
//every 15sec
window.setInterval(function(){
fetch('https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=myuser&api_key=myapikey&format=json')
.then(function (response) {
return response.json();
})
.then(function (data) {
appendData(data);
})
.catch(function (err) {
console.log('error: ' + err);
});
}, 15000);//every 15sec
function appendData(data) {
var song = document.getElementById("song");
song.innerHTML = "'"+data.recenttracks.track[0].name+"' in '"+data.recenttracks.track[0].album["#text"]+"' by '"+data.recenttracks.track[0].artist["#text"]+"'";
}
then I got that warning "Mixed Content: The page at 'https://mylittleradio.com/' was loaded over HTTPS, but requested an insecure audio file 'http://myip:myport/'. This content should also be served over HTTPS."
This is a warning but very soon will be blocking since the web is moving forward to be more secure with https by default everywhere nowadays.
So this is my question, is there a way to configure nginx in order to add ssl certificate configuration to my stream url ?
I also looked about icecast2 that does that but I am really keen on mixing to many software together when nginx is already there and shall be able to do the job.
Hope it is more clear and making sense.
Please don't hesitate to ask me specific details if I can provide to bring more clarity to my problematic.
thanks !