AdPlayer.Pro Video Streaming Capabilities
This article acts a reference to configuration options AdPlayer.Pro supports, regarding its video streaming capabilities, i.e. what media to play, player layout, its webpage behavior, etc.
Overview
The AdPlayer.Pro HTML5 video player enables the smooth streaming of video files in all formats, supported by a viewer’s web browser manufacturer, – across all platforms and screens.
See below for more details regarding the player script code, available configuration options, dynamic content management opportunities, and more.
Player Script Code Example
Your dedicated account manager at AdPlayer.Pro will provide you with the default JS code for further use and customization (see Player Script Configuration Reference below).
Example (static player size):
<div id="divAdPlayerPro"></div> <script src="https://static.adplayer.pro/player/AdPlayerPro.js"></script> <script>(function () { AdPlayerPro("divAdPlayerPro").setup({ "placementId": "E4PwNl4FEpNx", "muted": true, "autoStart": true, "width": "640", "height": "360", "type": "inStream", "file": "https://static.adplayer.pro/video/ProPromoVideo.mp4", "advertising": { "tag": [ { "url": "https://static.adplayer.pro/vast/demo.xml", } ] } }) })(); </script>
Player Script Configuration Reference
NB! JavaScript Object Notation (JSON) is required in the syntax of the setup blocks. Please beware of the common JSON requirements, e.g. the need for a comma after all but the last element in a list, while configuring the script.
Parameter | Description | Value |
"muted" |
Configures whether the player is muted during playback start or not. |
true/false |
"tapToUnmute" |
Configures the “Tap to Unmute” button display. |
true/false |
"soundByHover" |
Configures the sound switch-on onhover. |
true/false |
"autoStart" |
Configures whether the player attempts to begin playback automatically or not. |
true/false |
"width" |
Сonfigures the player width:
Static player size – in pixels *If aspect ratio is configured – ONLY flexible player size applied (i.e. width MUST be configured as percentage). |
number/number% |
"height" |
Сonfigures the player height*, in pixels.
*If aspect ratio is configured – NOT applied. |
number |
"aspectratio" |
ONLY for flexible player size.
Configures proportions between the player width and height, if player width is configured as percentage, in the following format: x:y, where: x refers to the player width, |
x:y |
"type" |
Configures the player type. |
inStream |
"file" |
URL to the video content, selected for streaming, i.e.:
Examples:
Example: "file": {"type":"youtube","videoId":"YouTubeVideoID"},
Example: "file": {"type":"youtubePlaylist","videoId":"YouTubePlaylistID"},
|
string/JSON |
"file" : { "type" |
Configures the type of video content sequence, if the “file” parameter is a JSON object:
Example: "file": { "type":"rss" ... },
Example: "file": { "type":"playlist" ... }, |
string |
Available setup parameters for RSS Feed |
||
"file" : { "limit" |
Configures the maximum number of RSS feed posts enabled for display in-between ad requests.
Default value: 5 |
number |
"file" : { "url" |
Configures the RSS Feed URL.
Example: "file": { "type":"rss", "limit": "5", "url": "/player/xml/rss/jpostParsePage.com.rss.xml", ... }, |
string |
"file " : { "speed" |
Configures the RSS feed post duration in seconds.
Default value: 6 |
number |
"file" : { "parsePage" |
Optional. If ON, switches webpage parsing for images, if there are no images in the RSS Feed. Note! The “parsePage” parameter will only work in case the custom parser script is applied (i.e. |
true/false |
"file" : { "parser" |
Optional. If added, configures the custom script for parsing webpage content. If missing, the following default parser script is applied: { title: function () { return $item.find('title').text(); }, link: function () { return $item.find('link').text(); }, img: function () { return $("<b>" + $item.find('description').text() + '</b>').find('img').attr('src'); } }, The parser script supports the following variables:
EXAMPLE, with a custom parser script, used for parsing images on the webpage (actual script may "file": { "type": "rss", "limit": "5", "url": "/player/xml/rss/jpostParsePage.com.rss.xml", "parsePage": "true", "parser": "parser.img = function () { return $("<b>" + $item.find("description").text() + "</b>").find("img").attr("src") || ($page && $page.find(".article-image img").attr("src"))}" }, |
string (Javascript) |
Available setup parameters for video playlists |
||
"file" : { "name" |
Configures the video playlist name. Example: "file": { "type":"playlist", "name": "MyPlaylist", "playlist": [ … ] }, |
string |
"file" : { "playlist": [] |
For each video file in the playlist, you can configure the following parameters:
Example: "file": { "type":"playlist", "playlist": [ {"file": "https://adplayer.pro/video/1.mp4", "duration": "10", "title": "One", "image": "https://adplayer.pro/img/1.jpg", "description": "This is Video One"}, {"file": "https://adplayer.pro/video/2.mp4", ... } ] }, |
string |
"tracks": [{ |
Sequence of parameters, configuring the display of image thumbnails in video (VTT).
See below. |
|
"tracks": [{ "file" |
Configures the URL to the externally hosted *.vtt file. Example: "file": "https://example.com/preview.vtt" |
string |
"tracks": [{ "kind" |
Optional. Configures the VTT type. Example: "kind": "thumbnails" |
string |
"errorMessage" |
Configures the error message describing what went wrong.
Example: "errorMessage": "Video is not available" |
string |
Dynamic Content Management
AdPlayer.Pro enables managing streamed video content programmatically by a mere few clicks – by changing the “file” parameter value (URL).