Since Vice 1.3.0 you can create unlimited Radio Channels. A radio channel is composed of:
- A visible radio channel page (with its own custom post type and a custom template in the theme)
- A featured image (or logo)
- A playable stream of the radio station
Creating the radio channel:
To simply create a radio channel page, use the title and text editors like you do for a normal page. The created page has a template in the front-end that you can copy to your child theme and customize named: single-radiochannel.php.
Creating the playable channel
A playable channel is an entry in the playlist of the website.
To view the radio channel in the player, you need to do two things:
- Compile the Radio Channel Details when you create a new radio channel.
- Have your player visible under Appearance->Customize
How to compile the radio player details MP3 Stream URL:
Mp3 Stream URL
This is the address where your radio station streams the audio stream.
To use the built-in players, you need the mp3 URL of your radio stream.
To obtain the mp3 url, it is very simple:
Usually the web radio stations provide a file that will allow you to stream the radio on iTunes, Winamp, Windows Media Player and other players.
How to find your MP3 Stream URL
PLEASE USE THE FOLLOWING INFORMATION TO CHECK IF YOUR RADIO STATION IS COMPATIBLE.
IF YOU ALREADY KNOW YOUR MP3 STREAM URL, YOU CAN SKIP THIS CHAPTER OTHERWISE READ ON…
This service is provided using a file ending in .m3u or .playlist
You can obtain the url of the mp3 stream by using one of these files, of course use the URL provided from your radio provider, not the ones in this example:
- Get the URL of the player from your radio provider. For Wavestream users, you find this URL in the integration tools:
- Download one of the files for the integration. It is a simple text file, masked as a different file format.
- Rename the file to player.txt
- Open this file with any text editor, like notepad (PC) or TextEdit (Pac)
- You will find something like this:
#EXTM3U #EXTINF:-1,06 AM Ibiza Underground http://173.192.105.231:3540/Live
This URL will be your mp3 stream, just add “.mp3″ in the end, like this:
…….yourUrl/Live.mp3
To be sure that your mp3 stream is valid, open it in the browser, with a modern browser it should render as a music player, and reproduce your radio stream.
If the radio stream works correctly, you can integrate it on your site.
Adding the radio station to the playlist
This is the checkbox to add the radio channel to the playlist of the theme player, that appears at the bottom of the page.
Radio streams don’t allow advancing in the player track.
Radio stations can by default only be played in the website player, but you can hide radio stations from displaying and you can add your own player to the content of the radio station text.
Advanced information for developers:
- To customize the radio aspect in the playlist, the template is part-radiostations.php
- The actual page for radio stations is single-radiochannel.php
- Radio stations are added via PHP in the part-radiostations.php while normal tracks are added with an ajax call
- Radio stations are added to the main playlist in part-playlist.php