Config

Lever the settings for a custom player setup

Snippet structure

To configure the player it is essential to understand the elements containing the snippet.

Player snippet consists of 2 <script> tags
<script src="CodoPlayer.js" type="text/javascript"></script>
<script>
CodoPlayer("video.mp4", {
	width: 600,
	height: 338
})
</script>
First <script> tag defines a link to "CodoPlayer.js" script & must always stay above the player caller method. Second <script> tag defines a caller method to initiate the player with content & settings defined.
Player constructor method accepts 2 parameters
CodoPlayer( mediaObj , settingsObj )
settingsObj is optional (settings default).

Media object (mediaObj)

Defines the source URL to media and configures title and poster associated with clip.

String

The basic media object setup can be a string
CodoPlayer("video.mp4")
To make the playlist of clips - an array of strings
CodoPlayer(["video.mp4", "video2.mp4", "video3.mp4"])

Object

For a single clip - an object literal
CodoPlayer({
	title: "My video",
	src: "video.mp4"
})
For a playlist of clips - an array of object literals
CodoPlayer([{
	title: "My video 1",
	src: "video.mp4"
},
{
	title: "My video 2",
	src: "video2.mp4"
}])

Mixed

For a playlist of clips with first clip as string, second clip as object literal
CodoPlayer([
	"video.mp4",
{
	title: "My video 2",
	src: "video2.mp4"
}])

All properties of media object

CodoPlayer({
	src: ["video.webm", "video.ogv", "video.mp4"],
	title: "My video title",
	poster: "image.jpg",
	engine: "auto",
	cuepoints: [5, 10, 15]
})

Settings object (settingsObj)

This object defines player initial properties (width, height, autoplay, volume, +)

To customise simply add a new key to a settings object
CodoPlayer("video.mp4", {
	width: 600,
	height: 338
})

All properties of settings object

CodoPlayer('video.mp4', {
	width: 600,
	height: 338,
	preload: true,
	autoplay: false,
	loop: false,
	volume: 80,
	engine: 'auto' / 'html5' / 'flash',
	playlist: true,
	logo: "path_to_image.png", // (PRO)
	loader: "path_to_image.gif", // (PRO)
	controls: true,
	id: "player-1"
})

Control bar object

Player settings object accepts the following properties for control bar manipulation.
CodoPlayer('video.mp4', {
	width: 600,
	height: 338,
	controls: {
		show: 'auto' / 'always' / 'never',
		hideDelay: 5,
		play: true,
		playBtn: true,
		seek: true,
		volume: false / 'horizontal' / 'vertical',
		fullscreen: true,
		title: true,
		time: true
	}
})

Complete setup example

CodoPlayer([{
	src: ["video1.webm", "video1.ogv", "video1.mp4"],
	title: "My video title 1",
	poster: "image1.jpg",
	engine: "auto",
	cuepoints: [5, 10, 15]
},
{
	src: ["video2.webm", "video2.ogv", "video2.mp4"],
	title: "My video title 2",
	poster: "image2.jpg",
	engine: "auto",
	cuepoints: [5, 10, 15]
},
{
	src: ["video3.webm", "video3.ogv", "video3.mp4"],
	title: "My video title 3",
	poster: "image3.jpg",
	engine: "auto",
	cuepoints: [5, 10, 15]
}], {
	width: 600,
	height: 338,
	preload: true,
	autoplay: false,
	loop: false,
	volume: 80,
	engine: "auto",
	playlist: true,
	logo: "path_to_image.png", // PRO version only
	loader: "path_to_image.gif", // PRO version only
	controls: {
		show: "auto",
		hideDelay: 5,
		play: true,
		playBtn: true,
		seek: true,
		volume: true,
		fullscreen: true,
		title: true,
		time: true
	},
	id: "player-1"
})