Player with ui written in valinna js, that is, framework free.
The main purpose is to usage anywhere regardless of frontend framework ( for example:angular, react).
className
: custom class name- type:
string
- optional
- default: ""
- type:
value
: setup the slider with a initial value- type:
number
- optional
- default: 0
- type:
draggerSize
: the size of the dot dragger inpx
- type:
number
- optional
- default: 12
- type:
barHeight
: the height of the slider bar inpx
- type:
number
- optional
- default: 2
- type:
onChange
: callback when the slider slides- type:
(value)=>{}
- optional
- default: null
- type:
min
: minimal value of the range- type:
number
- optional
- default: 0
- type:
max
: maxmium value of the range- type:
number
- optional
- default: 100
- type:
precision
: precisoin of the output- type:
number
- optional
- default: 0
- type:
new RangeSlider(node,options);
<div id="mySlider"></div>
import RangeSlider from "../src/rangeSlider";
new RangeSlider(document.querySelector("#mySlider"));
parent
: DOM node to render to- type:
DOM Node
- required
- default:
document.body
- type:
url
: the url to play- type:
string
- required
- default: ``
- type:
new AudioPlayer(options);
<div id="myPlayer"></div>
import RangeSlider from "../src/audioPlayer";
new AudioPlayer({
parent: document.querySelector("#audioPlayer2"),
url: "url/for/audio"
});
parent
: DOM node to render to- type:
DOM Node
- required
- default:
document.body
- type:
url
: the url to play- type:
string
- required
- default: ``
- type:
isInlinePlay
: play the video inline or in popup dialog- type:
boolean
- optional
- default:
true
- type:
new VideoPlayer(options);
<div id="videoPlayer"></div>
import VideoPlayer from "../src/videoPlayer";
new VideoPlayer({
parent: document.querySelector("#videoPlayer"),
url: "url/for/video"
});
Mixed audio and video player with the guarantee that only one of them is playing.
type
: media type,audio
orvideo
- type:
string
- required
- default: N/A
- type:
options
: same as corresponding media options, see video options or audio options- type:
object
- required
- default: N/A
- type:
new MediaPlayer(type, options);
<div id="audioPlayer"></div>
<div id="videoPlayer"></div>
import MediaPlayer from "../src/index";
new MediaPlayer('audio',{
parent: document.querySelector("#audioPlayer"),
url: "url/for/audio"
});
new MediaPlayer('video',{
parent: document.querySelector("#videoPlayer"),
url: "url/for/video"
});