wp/wp-includes/js/mediaelement/renderers/vimeo.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
     6  * using a variety of technologies (pure JavaScript, Flash, iframe)
     6  * using a variety of technologies (pure JavaScript, Flash, iframe)
     7  *
     7  *
     8  * Copyright 2010-2017, John Dyer (http://j.hn/)
     8  * Copyright 2010-2017, John Dyer (http://j.hn/)
     9  * License: MIT
     9  * License: MIT
    10  *
    10  *
    11  */(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
    11  */(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(_dereq_,module,exports){
    12 'use strict';
    12 'use strict';
    13 
    13 
    14 var VimeoApi = {
    14 var VimeoApi = {
    15 
    15 
    16 	promise: null,
    16 	promise: null,
    31 		var player = new Vimeo.Player(settings.iframe);
    31 		var player = new Vimeo.Player(settings.iframe);
    32 		window['__ready__' + settings.id](player);
    32 		window['__ready__' + settings.id](player);
    33 	},
    33 	},
    34 
    34 
    35 	getVimeoId: function getVimeoId(url) {
    35 	getVimeoId: function getVimeoId(url) {
    36 		if (url === undefined || url === null) {
    36 		if (url == null) {
    37 			return null;
    37 			return null;
    38 		}
    38 		}
    39 
    39 
    40 		var parts = url.split('?');
    40 		var parts = url.split('?');
    41 		url = parts[0];
    41 		url = parts[0];
    42 		return parseInt(url.substring(url.lastIndexOf('/') + 1), 10);
    42 
       
    43 		var playerLinkMatch = url.match(/https:\/\/player.vimeo.com\/video\/(\d+)$/);
       
    44 		if (playerLinkMatch) {
       
    45 			return parseInt(playerLinkMatch[1], 10);
       
    46 		}
       
    47 
       
    48 		var vimeoLinkMatch = url.match(/https:\/\/vimeo.com\/(\d+)$/);
       
    49 		if (vimeoLinkMatch) {
       
    50 			return parseInt(vimeoLinkMatch[1], 10);
       
    51 		}
       
    52 
       
    53 		var privateVimeoLinkMatch = url.match(/https:\/\/vimeo.com\/(\d+)\/\w+$/);
       
    54 		if (privateVimeoLinkMatch) {
       
    55 			return parseInt(privateVimeoLinkMatch[1], 10);
       
    56 		}
       
    57 
       
    58 		return NaN;
    43 	}
    59 	}
    44 };
    60 };
    45 
    61 
    46 var vimeoIframeRenderer = {
    62 var vimeoIframeRenderer = {
    47 
    63