Aniview instream player in is used in order to play content videos and ads.
The player has a very flexible configuration in order to match to the customer's requirements.
Sample Configuration
Code Block |
---|
<div id="theplayer"> </div> <script type="text/javascript"> (function(() { var config = { adConfig : { publisherId : "Your id", channelId : "Your id", ref1 : "", width : 100, height : 0, autoPlay : true, soundButton : true, pauseButton : true, closebutton : false, errorlimit : 100, vastRetry : 0, loop : true, position : "" }, position : "theplayer", width : 100, height : 0, showBigPlay : true, showBigPlayOnPause : true, showBigPrevNextOnPause : true, soundButtonPosition : "right", showPauseButton : true, showPrevButton : false, showNextButton : false, showBigPrevNext : true, showSoundButton : true, showVolumeControl : true, volumeControlVertical : true, showErrorScreen : true, durationPosition : "right", playlistAutoSkipOnError : true, showUiOnPause : false, showTimelineReplay : true, viewPercentageRequired : 1, showFullScreen : false, showDuration : true, hideGuiOnMouseout : true, hideGuiTimeout : 1, timelineMode : "default", spinner : "default", theme : "solid", themeColor : "#ff0000", playOnView : false, logo : { url : "LINK_TO_PNG", text : false, size : [ 90, 42 ], position : "left" }, startVolume : 1, syncVolume : true, autoPlay : false, autoLoop : true, autoContinue : true, showReplay : true, mobile : { "showBigPlay" : true, "showBigPlayOnPause" : true, "showBigPrevNext" : true, "showUiOnPause" : false, "showPauseButton" : true, "showPrevButton" : false, "showNextButton" : false, "showFullScreen" : false, "hideGuiTimeout" : 2 }, replayText : "Replay", content : { "order" : 1, "randomFrom" : 1, "breakingAds" : 15, "breakingAdsMode" : "op", "contents" : [{ "id" : "ID1", "url" : "LINK_TO_MP4", "fallbackUrl" : "LINK_TO_FALLBACK_MP4", "clickThroughUrl" : "CLICKTHROUGH_URL", "type" : "video", "slots" : [{ "type" : "ad", "time" : 0 } ] }, { "id" : "ID2", "url" : "LINK_TO_MP4", "fallbackUrl" : "LINK_TO_FALLBACK_MP4", "clickThroughUrl" : "CLICKTHROUGH_URL", "type" : "video", "slots" : [{ "type" : "ad", "time" : 0 } ] } ] "firstPrerollSlot": { "time": 0, "firstAdTimeOut": 15, "preloadAdTime": 5, "maxAds": 1, "nextAdTimeout": 8 }, "commonSlots": [{ "time": 5, "firstAdTimeOut": 15, "preloadAdTime": 5, "maxAds": 1, "nextAdTimeout": 8 }, { "time": 10, "firstAdTimeOut": 15, "preloadAdTime": 5, "maxAds": 1, "nextAdTimeout": 8 }, { "time": 15, "firstAdTimeOut": 15, "preloadAdTime": 5, "maxAds": 1, "nextAdTimeout": 8 } ], } }; function downloadScript() { var scp = document.createElement('script'); scp.src = "https://player.avplayer.com/script/2/v/avcplayer.js"; scp.onload = function () { var AniviewContentPlayer = com.aniview.player.AniviewContentPlayer; var player = new AniviewContentPlayer(config); player.nextContent(); } document.getElementsByTagName('head')[0].appendChild(scp); }; downloadScript(); })(); </script> |
...
https://player.avplayer.com/script/2/v/avcplayer.js
This player will always be updated to the latest versionhttps://player.avplayer.com/script/2/2.54/avcplayer.js
This will point to a specific version. Its It's up to the customer to upgrade to a later release as needed
...
Default adConfig is defined in config.adConfig. This configuration is used by default for all ads in the player.
In “default“ mode its it's possible to define a specific configuration per slot that will override the default adConfig - example below
...
breakingAdsMode: Ads configuration mode
“os“: In this mode, the player runs the ad module and whenever and an ad is available it will break and pause the content.
In this mode, only the default adConfig is used and slots configuration is ignored.
There are multiple ways to control the aggressiveness of the player such as impCap per content, breakingAds: 10 that will create an interval between waterfall runs, and additional ads ad player configurations.“op“: In this mode the , a player will allow ads as defined in the configuration of the slots configuration. The A player will use only the default adConfig.
The advantage of this mode is that it will precache and use ads found in one slot on the next slot while the default mode below will work like vpaid, meaning it will load the ads module separetly separately for each slot and will dump unused ads.
In this mode breakingAds must be set to false.“default“: in this mode, the defined slots define the time when ads are called. Each slot may have its time and timeout. As well, it is possible to define for each slot the channel that will be used and the adConfig configuration
Code Block config: { adConfig: { //Default ad config to be used in all slots }, content: { contents: [{ //Content configuration slots: [{ adConfig:{ //All relevant ad config parameters specific to this slot //This will override the default adConfig }, time: 0 }] }] } }
In default mode, breakingAds must be set to false: breakingAds : false
breaking ads: This parameter is relevant only if breakingAdsMode - “os“. for example, breakingAds: 10
breaking ads define the time interval between ads - its it's similar to midrollTime in the ads player.
...
Slots define the time where we want the ad to appear. In each slot, the time of the ad is defined. time
Time: 0 means prerol; - this pre roll. This means that we will search for ads for the configured timeout and will display an ad (if available) before the content.
Slots configuration is relevant only in default and op modes. In os OS mode slots are ignored.
Each slot can define the number of ads that we want to show in the slot (v 2.54 and above)
In midroll slots, the time is the desired time (seconds) of the ad slot relative to the content time. The actual time when the ads will appear can be slightly different as we are not pausing the content and there may be some timeout of the ad to start
...
In order to implement a session with 2 ads in the first preroll, 2 post rolls, and 2 prerolls in the next contents the following configuration can be used:
...