¿Sabía usted Bot Libre también ofrece conexión alojado foros para su propio sitio web o una aplicación móvil?
Self, AIML, and scripting : making a web-radio player?

RE: making a web-radio player?

por admin publicado Jun 21 2022, 8:53

So the bot in this script uses "commands" in Bot Libre to pass back the audio commands to the client.

Your web or mobile client needs to process these commands to play the audio.

In the example website it uses some JavaScript code to process the audio command, you need this code for you bot to play audio.

var audio = new Audio();
function PlayMusic() {
this.updateAvatar = function(response) {
if (response.command != null) {
var command = JSON.parse(response.command);
console.log(command);
if (command.cmd == "play") {
audio.pause();
audio.src = command.url;
audio.play();
} else if (command.cmd == "pause") {
audio.pause();
}
}
}
}

web.game = new PlayMusic();


by ronxtcdabass posted Jun 21 2022, 12:55

WOW!!!!

 

thank you for the fast help!

it works...

edited: it works in my html file at my PC but online at my webspace works only [Soma FM] ...

my testpage: Test


Updated: Jun 21 2022, 14:47
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 900, today: 2, week: 3, month: 10

Id: 43456779
Publicado: Jun 21 2022, 8:53
Respuestas: 1
Vistas: 930, hoy: 1, la semana: 5, mes: 12
1 0 5.0/5