All Projects → mysuf → videojs-ima-player

mysuf / videojs-ima-player

Licence: other
video ad plugin for video.js

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to videojs-ima-player

generator-videojs-plugin
Yeoman generator for video.js plugins.
Stars: ✭ 71 (+491.67%)
Mutual labels:  videojs, videojs-plugin
videojs-share
Share plugin for video.js
Stars: ✭ 24 (+100%)
Mutual labels:  videojs, videojs-plugin
videojs-landscape-fullscreen
Videojs on Mobile and/or React: Automatically Switch to Landscape on Fullscreen, and Fullscreen on Landscape
Stars: ✭ 72 (+500%)
Mutual labels:  videojs, videojs-plugin
videojs-annotation-comments
A plugin for video.js to add support for timeline moment/range comments and annotations
Stars: ✭ 129 (+975%)
Mutual labels:  videojs, videojs-plugin
videojs-plus
An extension and skin for video.js
Stars: ✭ 49 (+308.33%)
Mutual labels:  videojs, videojs-plugin
videojs-airplay
Videojs Plugin that adds an airplay button to the control bar
Stars: ✭ 28 (+133.33%)
Mutual labels:  videojs, videojs-plugin
Videojs Playlist
A plugin to play multiple audio tracks or multiple videos.
Stars: ✭ 63 (+425%)
Mutual labels:  videojs
Videojs Contrib Hls
HLS library for video.js
Stars: ✭ 2,723 (+22591.67%)
Mutual labels:  videojs
Wjplayer
Video.js bundle that supports HLS, VAST/VMAP, 360-degree videos, and more.
Stars: ✭ 55 (+358.33%)
Mutual labels:  videojs
Videojs Youtube
YouTube playback technology for Video.js
Stars: ✭ 948 (+7800%)
Mutual labels:  videojs
videojs-hlsjs
HLS playback plugin for videojs
Stars: ✭ 26 (+116.67%)
Mutual labels:  videojs
vlitejs
🦋 vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo, Dailymotion)
Stars: ✭ 162 (+1250%)
Mutual labels:  ima-sdk
Videojs Hotkeys
Adds more hotkey support to video.js
Stars: ✭ 155 (+1191.67%)
Mutual labels:  videojs
Embed
Embed player for D.Tube
Stars: ✭ 65 (+441.67%)
Mutual labels:  videojs
h5-qj
全景h5,商场活动,在商场场景下寻找企业LOGO展示优惠活动。
Stars: ✭ 18 (+50%)
Mutual labels:  videojs
React Awesome Player
🔥 video.js component for React
Stars: ✭ 56 (+366.67%)
Mutual labels:  videojs
react-hook-videojs
Easy React integration of Video.js using hooks.
Stars: ✭ 37 (+208.33%)
Mutual labels:  videojs
Videojscustomization
HTML5 视频播放器 自定制: React + video.js 详细讲解
Stars: ✭ 32 (+166.67%)
Mutual labels:  videojs
Html5 Dash Hls Rtmp
🌻 HTML5播放器、M3U8直播/点播、RTMP直播、低延迟、推流/播流地址鉴权
Stars: ✭ 1,805 (+14941.67%)
Mutual labels:  videojs
Videojs Transcript
▶️📃 Interactive transcript plugin for video.js
Stars: ✭ 106 (+783.33%)
Mutual labels:  videojs

Video ad plugin for video.js

Introduction

IMA SDK integration for video.js. Based on customized videojs player, tech and UI tailored for ad playback.

Note: this is not official IMA SDK integration.

Requirements

Installation

npm install videojs-ima-player

Simple example

<html>
  <head>
    <!-- Load dependent stylesheets. -->
    <link href="path/to/video-js.css" rel="stylesheet">
    <link rel="stylesheet" href="path/to/videojs-contrib-ads.css" />
    <link rel="stylesheet" href="path/to/videojs.ima.css" />
  </head>

  <body>
    <video id="content_video" class="video-js vjs-default-skin"
        controls preload="auto" width="YOUR_VIDEO_WIDTH" height="YOUR_VIDEO_HEIGHT">
      <source src="PATH_TO_YOUR_CONTENT_VIDEO" type="YOUR_CONTENT_VIDEO_TYPE" />
    </video>
    <!-- Load order dependent scripts -->
    <script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
    <script src="/path/to/videojs.v6.0.1.and.later.js"></script>
    <script src="/path/to/videojs-contrib-ads.v6.2.0.and.later.js"></script>
    <script src="/path/to/videojs.ima.js"></script>
    <script>
      var player = videojs("content_video");
      player.ima({adTagUrl: 'YOUR_AD_TAG'});
    </script>
  </body>
</html>

Playlist, quality switcher, etc.

If content player's source is changed, it reinitialize IMA SDK and play ads again. To prevent this behaviour (i.e. switching quality), you have to set player.ads.contentSrc="new-source.mp4" before calling player.src("new-source.mp4").

Methods (bound to player.ima)

updateOptions({options}) -- sets new IMA options. This options is applied once content player source is changed.

play() -- call this method to play ad only when autoPlayAdBreaks is set to false and adBreakReady occurs. Otherwise resumes paused ad.

pause() -- pauses current ad.

Events (bound to player.ima)

videojs's Player events

additional IMA SDK events

Usage: player.ima.on(...)/player.ima.off(...)

Settings

adTagUrl (string)
url of VMAP/VAST/VPAID resource. REQUIRED IF adsResponse IS NOT PROVIDED.

adsResponse (string)
response in VMAP/VAST/VPAID form. REQUIRED IF adTagUrl IS NOT PROVIDED.

adLabel (string)
Translation for text: "Advertisement". Default: "Advertisement"

adsRenderingSettings (Object)
IMA SDK ad rendering settings

autoPlayAdBreaks (boolean)
Autoplay ads. Default: true

contribAdsSettings (Object)
settings for contrib-ads plugin.

debug (boolean)
contrib-ads debug log. Default: false

disableFlashAds (boolean)
Disables flash ads. Default: IMA SDK default

disableCustomPlaybackForIOS10Plus (boolean)
Enables inline playback on iOS 10+. Requires playsinline attribute on video tag. Default: false

forceNonLinearFullSlot (boolean)
Renders non linear ad as linear fullslot. Default: false

locale (string)
Sets locale based on ISO 639-1 (two-letter) or ISO 639-2 (three-letter) code. Default: 'en'

nonLinearWidth (number)
Sets width of non-linear ads. Default: width of content player

nonLinearHeight (number)
Sets height of non-linear ads. Default: 1/3 of content player height

numRedirects (number)
Maximum number of VAST redirects. Default: IMA SDK default

ofLabel (string)
Translation for text "of" (e.g. "1 of 2"). Default: of"

showControlsForJSAds (boolean)
Enables controls for VPAID JavaScript ads. Default: true

showCountdown (boolean)
Enables countdown timer. Default: true

timeout (number)
contrib-ads hard timeout for loading preroll/postroll ads. Default: 5000

vpaidMode (VpaidMode)
google.ima.ImaSdkSettings.VpaidMode. Default: ENABLED

Disabled ad autoplay

Timing of ad playback is handled by IMA SDK. If autoplayAdBreaks is set to false, this feature is turned off and is up to you when you play the ad (once adBreakReady is triggered).

  1. Set autoPlayAdBreaks to false
  2. Listen and play on adBreakReady player.ima.on('adBreakReady', player.ima.play)

About timeouts

This integration use hard timeout 5s. If ad is not loaded within given time, IMA silently skips current ad and resumes content playback. You can adjust this timeout by timeout setting. As IMA SDK supports only one timeout value, different preroll/postroll timeouts are not supported in this plugin. Default: timeout = 5000, adsRenderingSettings.loadVideoTimeout = timeout.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].