Files
videojs-player/js/videojs-watermark.min.js

7 lines
2.1 KiB
JavaScript

/**
* videojs-watermark
* @version 2.0.0
* @copyright 2017 Brooks Lyrette <brooks@dotsub.com>
* @license Apache-2.0
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.videojsWatermark=e()}}(function(){return function e(n,t,i){function o(d,a){if(!t[d]){if(!n[d]){var f="function"==typeof require&&require;if(!a&&f)return f(d,!0);if(r)return r(d,!0);var u=new Error("Cannot find module '"+d+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[d]={exports:{}};n[d][0].call(l.exports,function(e){var t=n[d][1][e];return o(t||e)},l,l.exports,e,n,t,i)}return t[d].exports}for(var r="function"==typeof require&&require,d=0;d<i.length;d++)o(i[d]);return o}({1:[function(e,n,t){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,o=function(e){return e&&e.__esModule?e:{default:e}}(i),r={position:"top-right",fadeTime:3e3,url:void 0,image:void 0},d=function(e,n){var t=e.el(),i=document.createElement("div"),o=document.createElement("img");if(i.classList.add("vjs-watermark-content"),i.classList.add("vjs-watermark-"+n.position),o.src=n.image,n.url){var r=document.createElement("a");r.href=n.url,r.onclick=function(t){t.preventDefault(),e.pause(),window.open(n.url)},r.appendChild(o),i.appendChild(r)}else i.appendChild(o);t.appendChild(i)},a=function(e){setTimeout(function(){return document.getElementsByClassName("vjs-watermark-content")[0].classList.add("vjs-watermark-fade")},e.fadeTime)},f=function(e,n){e.addClass("vjs-watermark"),n.image&&(d(e,n),null!==n.fadeTime&&e.on("play",function(){return a(n)}))},u=function(e){var n=this;this.ready(function(){f(n,o.default.mergeOptions(r,e))})};o.default.registerPlugin("watermark",u),u.VERSION="2.0.0",t.default=u,n.exports=t.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});