Flask: Stream radio

0

This is the first one that I will try to embark on in this style project and I have some doubts that I would like to clarify, this may sound very lay.

I will use Flask for development and radio is established on the SHOUTcast platform, I connect behind a IP:PORTA . I'm starting to gradually understand the architecture of Flask, I had already done a little project using it and I liked it a lot.

Now to create an audio player, how can it be done? Using Python, HTML? I still can not figure out how to work with it.

Can be used Plyr ?

    
asked by anonymous 21.04.2018 / 21:02

1 answer

1

If you already have the separate streaming server, you need to get a " <audio /> " tag with the appropriate parameters in the browser - this is the part you make in the flask.

The recommendation is for you to test with a static page first - here is good documentation: link

When it's okay, if it's the same link for all users, you can leave the static tag, or if you fill in the audio element and server address, etc in the template, with variables that are managed in the view in Python.

If your final application is a web application - where you maintain a single HTML page and update it with asynchronous requests to the server - the same thing - the Python view will actually pass the URL on the server , and the Javascript part of your app will create the audio tag with these parameters.

    
22.04.2018 / 19:14