-
Link stylesheet
ytplayer.css
<link rel="stylesheet" media="screen,projection,tv" href="ytplayer.css" type="text/css">
-
Import Zepto.js or JQuery
-
Zepto.js
<script type="text/javascript" src="zepto.js"></script>
-
jQuery
<script type="text/javascript" src="jquery.min.js"></script>
-
-
Import YtPlayer
<script type="text/javascript" src="ytplayer.js"></script>
-
Add to page
<div>
with any ID<div id="ytplayer"></div>
-
Create player (set options & list of videos)
<script type="text/javascript"> YtPlayer.create(yourDivId, listOfVideos[, options]); </script>
yourDivId
- stringlistOfVideos
- array of objectsoptions
- object - [optional]
[
video1,
video2,
...
]
-
video1
,video2
, ...{ name: 'YT example video', id: 'u1zgFlCw8Aw' }
{
opt1: value,
opt2: value,
...
}
width
(int) - default:640
height
(int) - default:390
playerId
(string) - default:'ytplayer-ytplayer'
tryNum
(int) - default:10
strNext
(string) - default:'Next'
strPrev
(string) - default:'Prev'
strCycle
(string) - default:'Cycle'
strRandom
(string) - default:'Random'
cycle
(bool) - default:true
randomly
(bool) - default:false
thumbs
(bool) - default:false
- see file
index.html
- for more information see
license.txt
- Jan Pecha (http://janpecha.iunas.cz)