Menu

Set media source files

There are five different ways to set media source file into thisPlayer media object. Each ways are useful and very easy to understand.

Setup via regular HTML5 media element

In case of regular HTML5 media element you do not need any special setup for source files, just add HTML <source> elements into your <video> or <audio> element and do not forget to specify an attribute data-thisplayer to generate thisPlayer in place of regular HTML5 media player. See an example below:

<video data-thisplayer>
    <source src="/your-folder/video1.mp4">
    <source src="/your-folder/video2.mp4" type="video/mp4">
</video>

Set a media source file URL

For very fast setup you can use just one media source file. Set URL of the media file as string value of resources option.
See an example below:

var tp = thisPlayer({
    container: '#player-container',
    resources: '/your-folder/media-file.mp4' // The URL of media file to play
});

Set multiple media source files

As its known several media files are not working for all browsers what sometimes makes as to have multiple media file formats (for example ogv, wmv, mp4 etc) for multiple browsers.
thisPlayer lets you to have string URLs in array to provide multiple file formats. See an example below:

var tp = thisPlayer({
    container: '#player-container',
    resources: [
        '/your-folder/media-file.mp4',
        '/your-folder/media-file.ogv',
        '/your-folder/media-file.wma'
    ] // Multiple file formats into the array
});

Set single or multiple media source files with specifying mime type

Regularly you need to specify the mime type of source file when you're setting it into media element, but when you're not providing it, thisPlayer does setting mime type automatically based on your source file. if you want to set the mime type manually you can use this setup of the media source files - see an example below:

var tp = thisPlayer({
    container: '#player-container',
    resources: [
        ['/your-folder/media-file.mp4', 'video/mp4'], // Setting of mime type as 2nd item fo array
        ['/your-folder/media-file.3gp', 'video/3gpp'],
        ['/your-folder/media-file.flv', 'video/x-flv']
    ]
});