
Weborama announces playlists for media players
In view of the series of colds in our team, I had to skip the release of the mod for GTA SA and instead announce playlist generators.
With the help of playlist generators, we want to implement two things:
1. Make listening to music from a webrama as convenient as possible for the end user (in any player, on any OS).
2. Provide the ability to integrate the web frame into media devices and software.
Webrama playlists are lists of songs compiled over a set of parameters passed to the generator. The transport is the HTTP protocol, which means that the generator is a CGI script that takes parameters according to HTTP rules, that is, through GET or POST.
With the help of playlist generators, we want to implement two things:
1. Make listening to music from a webrama as convenient as possible for the end user (in any player, on any OS).
2. Provide the ability to integrate the web frame into media devices and software.
Webrama playlists are lists of songs compiled over a set of parameters passed to the generator. The transport is the HTTP protocol, which means that the generator is a CGI script that takes parameters according to HTTP rules, that is, through GET or POST.
More about the parameters:
- id - the identifier of the content for which data is being fetched. 0 - means that you need to generate a random playlist - therefore it is applicable only with type = playlist. When used with type = audio, the hash of the song; for type = playlist and type = album, go.
- type - type of generated content.
It can take 3 values:
'audio' - select a playlist with a single song whose identifier is passed in the id parameter
'album' - select a playlist from the songs of a particular album whose identifier is passed in the id
'playlist' parameter - select a playlist from the songs of a specific playlist of the user, whose identifier is passed in the id parameter. If id = 0 - there is a random selection of songs that satisfy the parameters passed (see below) - action - type of adding content to the playlist. Service optional parameter. With it, you can specify the actions that your handler should perform with the received data. For example, in order to add several entries to a player on a site, the click handler on the page sends a request with action = add.
- mood - mood of the user. It is an integer from 0 to 8, where
0 is sluggish-funny
1 - funny
2 - active-funny
3 - sluggish
4 - neutral
5 - active
6 - sluggish sad
7 - sad
8 - sad-active mood
If the value of the user mood variable is out of range (less than zero or greater than 8) or the parameter is not set, then the default mood is 4. - filter - filter for generated content. A string in which all pairs of values (parameter_name: value) are separated by a semicolon, and in the pair itself the parameter name is separated by a colon.
The following names may be
'userId' - user identifier
'genreId' - genre identifier Genre
table:
Electronic - 24
Russian pop music - 132
Alternative - 32
Soundtrack - 129
Jazz - 42
Russian rock - 131
Metal - 47
Retro - 130
Pop - 51
Punk - 54
Rhythm and Blues - 56
Rap - 57
Reggae - 59
Rock - 61
Classical - 128
Chanson - 133
Folk - 134
'sort' - the criterion by which the content will be selected
1) favorite - the user's favorite music
2) friends - his friends
3) uploaded - loaded by him
4) used_count and used_last - the one that listened
5) all - all the user's music
By default `all` value
The sort parameter can only be passed with the userId parameter - coverSize - the size of the album cover.
- limit - restriction on the length of the returned result - if not specified or 0: it is modified to 10 unless the filter is set to userId: in this case, the passed 0 means the need to return all records of the result. <./ li>
offset - indicates, starting with which song need to return limit recordsExamples of GET requests:
beta.weborama.ru/modules/player/index_xspf.php?id=0&type=playlist&act=add&mood=6&limit=50
This link generates a new playlist consisting of 50 songs that have a sixth mood, that is, a languid, sad one.
If you want to generate and play some playlist, then only 2 parameters will be required: identifier id = 0 and content type type = playlist. All other parameters (sort, mood, limit, action, offset and coverSize are optional)
www.weborama.ru/modules/player/index_xspf.php?id=0&type=playlist&act=new&mood=1&limit=11&sort=friends&offset=3
This link generates a playlist, with 11 tracks that match the cheerful mood. It starts to play from the third song, and all the songs are selected from those songs that the user's friends like.
If you want to play a specific playlist from the beginning, then you need to pass 2 parameters: id of the playlist id and content type type = playlist
www.weborama.ru/modules/player/index_xspf.php?id=18260&type=playlist
This link will start playing the playlist with the identifier 18260
If you want to play a specific playlist from a specific song number, you need to pass 3 parameters: id of the playlist id and content type type = playlist and offset value offset
www.weborama.ru/modules/player/index_xspf.php?id=2313&type=playlist&offset=3
A playlist with the identifier 2313 from the third song will start playing here
If you want to play a specific album from the beginning, you need to transfer only 2 parameters : album id id and content type type = album.
www.weborama.ru/modules/player/index_xspf.php?id=8060&type=album
An album with the identifier 8060 will start playing under this link
If you want to play a specific album not from the beginning, but from a specific song number, you need to pass 3 parameters: identifier album id and content type type = album and offset value offset.
www.weborama.ru/modules/player/index_xspf.php?id=8060&type=album&offset=3
This link will start playing the album with the identifier 8060 with the third song
if you want to play a specific song, you need to transfer only 2 parameters: the song identifier id and the content type type = audio
www.weborama.ru/modules/player/index_xspf.php ? id = 1c2afffc1fbf528f7993a6a3090af0eb & type = audio
This link will start playing the song with the identifier 1c2afffc1fbf528f7993a6a3090af0eb
At the moment we are exporting four types of playlists:- M3U - www.weborama.ru/modules/player/index_m3u.php
- PLS - www.weborama.ru/modules/player/index_pls.php
- ASF - www.weborama.ru/modules/player/index_asf.php
- XSPF - www.weborama.ru/modules/player/index_xspf.php
An example of use is our mobile playlist generator .
Posted by: necrosis