Play a PLS file using HTML5 audio

I want to play the .pls file, which is a radio file. When I click on this file, it plays the video in my iIunes (I use mac). I want to play this pls file in a browser, especially in Safari, since I want to play it on an iPhone.

My code is:

<audio src="radioveronica.pls" controls="controls">
    Your browser does not support the audio element.
</audio>

The following is the contents of my pls file:

[playlist]
File1=http://5713.live.streamtheworld.com:80/VERONICAAACCMP3
Title1=Radio Veronica
Length1=-1
File2=http://5713.live.streamtheworld.com:3690/VERONICAAACCMP3
Title2=Radio Veronica
Length2=-1
File3=http://5713.live.streamtheworld.com:443/VERONICAAACCMP3
Title3=Radio Veronica
Length3=-1
File4=http://5723.live.streamtheworld.com:80/VERONICAAACCMP3
Title4=Radio Veronica
Length4=-1
File5=http://5723.live.streamtheworld.com:3690/VERONICAAACCMP3
Title5=Radio Veronica
Length5=-1
File6=http://5723.live.streamtheworld.com:443/VERONICAAACCMP3
Title6=Radio Veronica
Length6=-1
NumberOfEntries=6
Version=2
+3
source share
3 answers

A PLS file is actually a text file containing a link or links to audio streams or other source files. There are no audio data in the file that can be played directly.

Only four formats are supported, supported by the sound tag (and not in all browsers):

  • Gg vorbis
  • MP3
  • Wav
  • (Safari , )
+2

shoutcast stream.nsv( ) icecast, , dj , shoutcast, :

<html>
    <head><title> Listen To Ma' Radio</title></head>
    <body>
    <audio controls="controls" src="http://50.22.217.113:13679/;&type=mp3"></audio>
    </body>
</html>

, html, php,

+6

Yes, you can cast via the HTML5 tag:

<audio controls="controls" src="http://IP:port/;stream.nsv&type=mp3"></audio>

Fantastic

+3
source

Source: https://habr.com/ru/post/1780517/


All Articles