mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
Fetch youtube videoid from url
This commit is contained in:
parent
776613b961
commit
2d4b0b8259
@ -24,7 +24,6 @@ var __extends = (this && this.__extends) || (function () {
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.et2_video = void 0;
|
||||
/*egw:uses
|
||||
/vendor/bower-asset/jquery/dist/jquery.js;
|
||||
et2_core_interfaces;
|
||||
@ -135,7 +134,7 @@ var et2_video = /** @class */ (function (_super) {
|
||||
'iv_load_policy': 0,
|
||||
'cc_load_policy': 0
|
||||
},
|
||||
videoId: _value.split('v=')[1],
|
||||
videoId: _value.match(et2_video.youtubeRegexp)[4],
|
||||
events: {
|
||||
'onReady': jQuery.proxy(self._onReady, self),
|
||||
'onStateChange': jQuery.proxy(self._onStateChangeYoutube, self)
|
||||
@ -417,6 +416,7 @@ var et2_video = /** @class */ (function (_super) {
|
||||
* @private
|
||||
*/
|
||||
et2_video.youtubePrefixId = "frame-";
|
||||
et2_video.youtubeRegexp = new RegExp(/^https:\/\/((www\.|m\.)?youtube(-nocookie)?\.com|youtu\.be)\/.*(?:\/|%3D|v=|vi=)([0-9A-z-_]{11})(?:[%#?&]|$)/m);
|
||||
return et2_video;
|
||||
}(et2_core_baseWidget_1.et2_baseWidget));
|
||||
exports.et2_video = et2_video;
|
||||
|
@ -136,6 +136,9 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
|
||||
* @private
|
||||
*/
|
||||
private static youtubePrefixId : string = "frame-";
|
||||
|
||||
private static youtubeRegexp: RegExp = new RegExp(/^https:\/\/((www\.|m\.)?youtube(-nocookie)?\.com|youtu\.be)\/.*(?:\/|%3D|v=|vi=)([0-9A-z-_]{11})(?:[%#?&]|$)/m);
|
||||
|
||||
constructor(_parent, _attrs? : WidgetConfig, _child? : object)
|
||||
{
|
||||
super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_video._attributes, _child || {}));
|
||||
@ -219,7 +222,7 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
|
||||
'iv_load_policy': 0,
|
||||
'cc_load_policy': 0
|
||||
},
|
||||
videoId: _value.split('v=')[1], //TODO get youtube video id
|
||||
videoId: _value.match(et2_video.youtubeRegexp)[4],
|
||||
events: {
|
||||
'onReady': jQuery.proxy(self._onReady, self),
|
||||
'onStateChange': jQuery.proxy(self._onStateChangeYoutube, self)
|
||||
|
Loading…
Reference in New Issue
Block a user