new AudioPlayer(It, Callback)
This method defines main AudioPlayer class. Constructor takes two parameter as arguments
Parameters:
| Name | Type | Description |
|---|---|---|
It |
Object | Contains default values of audio player like height , width , playlist |
Object.height |
Number | Height of Audio player like ( 1080 , 720px) |
Object.width |
Number | Width of Audio player like ( 1080 , 720px) |
Object.Playlist |
Array | Contains the playlist information of Audio Player. These lines create playlist array that need to be pass to audio player class. |
Object.cls |
String | Base class options |
Object.audioControls |
Boolean | Whether audio control required or not.This line creates a variable to hold audioLayer control value that will require to pass to audio * player class, on the basis of which class will create UI. TRUE - required FALSE - Not required |
Callback |
function | function after complition of AudioPlayer return back control to user agent |
Example
var audioPlayer_option = {
'cls' : 'boxCls',
'playList' : [{
"url" : audioFile1,
"title": 'Samsung Audio File1',
"artist": 'Samsung Artist 1',
"album": "TV Audio"
}, {
"url" : audioFile2,
"title": 'Samsung Audio File2',
"artist": 'Samsung Artist 2',
"album": "Washing Machine Audio"
}, {
"url" : audioFile3,
"title": 'Samsung Audio File3',
"artist": 'Samsung Artist 3',
"album": "MY Fav Audio"
}, {
"url" : audioFile4,
"title": 'Samsung Audio File4',
"artist": 'Samsung Artist 4',
"album": "My Collection Audio"
}],
'audioControls' : false
};
audioObj = caph.stripe.ui.widget.audioPlayer.getInstance(audioPlayer_option,callback);