diff --git a/src/api.ts b/api.d.ts similarity index 100% rename from src/api.ts rename to api.d.ts diff --git a/api.js b/api.js new file mode 100644 index 00000000..757c5fd9 --- /dev/null +++ b/api.js @@ -0,0 +1,7 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require('./services/vg-api')); +__export(require('./services/vg-fullscreen-api')); +__export(require('./events/VgEvents')); +//# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/api.js.map b/api.js.map new file mode 100644 index 00000000..3c9a2267 --- /dev/null +++ b/api.js.map @@ -0,0 +1 @@ +{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AAAA,iBAAc,mBAAmB,CAAC,EAAA;AAClC,iBAAc,8BAA8B,CAAC,EAAA;AAC7C,iBAAc,mBAAmB,CAAC,EAAA"} \ No newline at end of file diff --git a/api.ts b/api.ts new file mode 100644 index 00000000..7df033fe --- /dev/null +++ b/api.ts @@ -0,0 +1,3 @@ +export * from './services/vg-api'; +export * from './services/vg-fullscreen-api'; +export * from './events/VgEvents'; diff --git a/events/VgEvents.d.ts b/events/VgEvents.d.ts new file mode 100644 index 00000000..a9ec2107 --- /dev/null +++ b/events/VgEvents.d.ts @@ -0,0 +1,15 @@ +export declare class VgEvents { + static VG_CAN_PLAY: string; + static VG_CAN_PLAY_THROUGH: string; + static VG_LOADED_METADATA: string; + static VG_WAITING: string; + static VG_PROGRESS: string; + static VG_ENDED: string; + static VG_PLAYING: string; + static VG_PLAY: string; + static VG_PAUSE: string; + static VG_VOLUME_CHANGE: string; + static VG_PLAYBACK_CHANGE: string; + static VG_TIME_UPDATE: string; + static VG_ERROR: string; +} diff --git a/events/VgEvents.js b/events/VgEvents.js new file mode 100644 index 00000000..2b96cf9d --- /dev/null +++ b/events/VgEvents.js @@ -0,0 +1,20 @@ +var VgEvents = (function () { + function VgEvents() { + } + VgEvents.VG_CAN_PLAY = "canplay"; + VgEvents.VG_CAN_PLAY_THROUGH = "canplaythrough"; + VgEvents.VG_LOADED_METADATA = "loadedmetadata"; + VgEvents.VG_WAITING = "waiting"; + VgEvents.VG_PROGRESS = "progress"; + VgEvents.VG_ENDED = "ended"; + VgEvents.VG_PLAYING = "playing"; + VgEvents.VG_PLAY = "play"; + VgEvents.VG_PAUSE = "pause"; + VgEvents.VG_VOLUME_CHANGE = "volumechange"; + VgEvents.VG_PLAYBACK_CHANGE = "playbackchange"; + VgEvents.VG_TIME_UPDATE = "timeupdate"; + VgEvents.VG_ERROR = "error"; + return VgEvents; +})(); +exports.VgEvents = VgEvents; +//# sourceMappingURL=VgEvents.js.map \ No newline at end of file diff --git a/events/VgEvents.js.map b/events/VgEvents.js.map new file mode 100644 index 00000000..e1ddd2c5 --- /dev/null +++ b/events/VgEvents.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VgEvents.js","sourceRoot":"","sources":["VgEvents.ts"],"names":["VgEvents","VgEvents.constructor"],"mappings":"AAAA;IAAAA;IAcAC,CAACA;IAbUD,oBAAWA,GAAWA,SAASA,CAACA;IAChCA,4BAAmBA,GAAWA,gBAAgBA,CAACA;IAC/CA,2BAAkBA,GAAWA,gBAAgBA,CAACA;IAC9CA,mBAAUA,GAAWA,SAASA,CAACA;IAC/BA,oBAAWA,GAAWA,UAAUA,CAACA;IACjCA,iBAAQA,GAAWA,OAAOA,CAACA;IAC3BA,mBAAUA,GAAWA,SAASA,CAACA;IAC/BA,gBAAOA,GAAWA,MAAMA,CAACA;IACzBA,iBAAQA,GAAWA,OAAOA,CAACA;IAC3BA,yBAAgBA,GAAWA,cAAcA,CAACA;IAC1CA,2BAAkBA,GAAWA,gBAAgBA,CAACA;IAC9CA,uBAAcA,GAAWA,YAAYA,CAACA;IACtCA,iBAAQA,GAAWA,OAAOA,CAACA;IACtCA,eAACA;AAADA,CAACA,AAdD,IAcC;AAdY,gBAAQ,WAcpB,CAAA"} \ No newline at end of file diff --git a/src/events/VgEvents.ts b/events/VgEvents.ts similarity index 100% rename from src/events/VgEvents.ts rename to events/VgEvents.ts diff --git a/package.json b/package.json index fee6931d..b6b5e9ba 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,14 @@ "name": "videogular2", "version": "2.0.0-alpha", "description": "Videogular is a video application framework for desktop and mobile powered by Angular 2.0", + "main": "videogular2.js", "typings": "./videogular2.d.ts", "repository": { "type": "git", "url": "https://github.com/videogular/videogular2" }, "dependencies": { - "angular2": "2.0.0-alpha.44", - "es6-shim": "^0.33.6", - "systemjs": "0.18.4" + "angular2": "2.0.0-alpha.45" }, "devDependencies": { "del": "^1.1.1", @@ -28,13 +27,11 @@ "typescript": "^1.6.2" }, "scripts": { - "build": "./node_modules/.bin/gulp", - "dev": "./node_modules/.bin/gulp dev" + "prepublish": "tsc" }, "engines": { "node": ">=0.8.0" }, - "main": "gulpfile.js", "keywords": [ "video", "player", @@ -42,7 +39,7 @@ "angular2", "javascript" ], - "author": "Raul Jimenez (http://twofuckingdevelopers.com/)", + "author": "Raúl Jiménez (http://twofuckingdevelopers.com/)", "contributors": [ { "name": "Alberto García", diff --git a/src/player.ts b/player.d.ts similarity index 100% rename from src/player.ts rename to player.d.ts diff --git a/player.js b/player.js new file mode 100644 index 00000000..0f132062 --- /dev/null +++ b/player.js @@ -0,0 +1,5 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require('./vg-player/vg-player')); +//# sourceMappingURL=player.js.map \ No newline at end of file diff --git a/player.js.map b/player.js.map new file mode 100644 index 00000000..2d973586 --- /dev/null +++ b/player.js.map @@ -0,0 +1 @@ +{"version":3,"file":"player.js","sourceRoot":"","sources":["player.ts"],"names":[],"mappings":";;;AAAA,iBAAc,uBAAuB,CAAC,EAAA"} \ No newline at end of file diff --git a/player.ts b/player.ts new file mode 100644 index 00000000..c4cad94f --- /dev/null +++ b/player.ts @@ -0,0 +1 @@ +export * from './vg-player/vg-player'; diff --git a/src/plugins.ts b/plugins.d.ts similarity index 100% rename from src/plugins.ts rename to plugins.d.ts diff --git a/plugins.js b/plugins.js new file mode 100644 index 00000000..12f7b30d --- /dev/null +++ b/plugins.js @@ -0,0 +1,13 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require('./vg-controls/vg-controls')); +__export(require('./vg-controls/vg-fullscreen/vg-fullscreen')); +__export(require('./vg-controls/vg-mute/vg-mute')); +__export(require('./vg-controls/vg-play-pause/vg-play-pause')); +__export(require('./vg-controls/vg-playback-button/vg-playback-button')); +__export(require('./vg-controls/vg-scrub-bar/vg-scrub-bar')); +__export(require('./vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time')); +__export(require('./vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time')); +__export(require('./vg-overlay-play/vg-overlay-play')); +//# sourceMappingURL=plugins.js.map \ No newline at end of file diff --git a/plugins.js.map b/plugins.js.map new file mode 100644 index 00000000..4c316229 --- /dev/null +++ b/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.js","sourceRoot":"","sources":["plugins.ts"],"names":[],"mappings":";;;AAAA,iBAAc,2BAA2B,CAAC,EAAA;AAC1C,iBAAc,2CAA2C,CAAC,EAAA;AAC1D,iBAAc,+BAA+B,CAAC,EAAA;AAC9C,iBAAc,2CAA2C,CAAC,EAAA;AAC1D,iBAAc,qDAAqD,CAAC,EAAA;AACpE,iBAAc,yCAAyC,CAAC,EAAA;AACxD,iBAAc,oFAAoF,CAAC,EAAA;AACnG,iBAAc,gFAAgF,CAAC,EAAA;AAE/F,iBAAc,mCAAmC,CAAC,EAAA"} \ No newline at end of file diff --git a/plugins.ts b/plugins.ts new file mode 100644 index 00000000..6245b566 --- /dev/null +++ b/plugins.ts @@ -0,0 +1,10 @@ +export * from './vg-controls/vg-controls'; +export * from './vg-controls/vg-fullscreen/vg-fullscreen'; +export * from './vg-controls/vg-mute/vg-mute'; +export * from './vg-controls/vg-play-pause/vg-play-pause'; +export * from './vg-controls/vg-playback-button/vg-playback-button'; +export * from './vg-controls/vg-scrub-bar/vg-scrub-bar'; +export * from './vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time'; +export * from './vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time'; + +export * from './vg-overlay-play/vg-overlay-play'; diff --git a/services/vg-api.d.ts b/services/vg-api.d.ts new file mode 100644 index 00000000..2ee0b353 --- /dev/null +++ b/services/vg-api.d.ts @@ -0,0 +1,42 @@ +export declare class VgAPI { + medias: Object; + videogularElement: Object; + constructor(); + getDefaultMedia(): any; + getMediaById(id: string): any; + play(): void; + pause(): void; + duration: {}; + state: {}; + volume: {}; + playbackRate: {}; + canPlay: {}; + canPlayThrough: {}; + isMetadataLoaded: {}; + isWaiting: {}; + isCompleted: {}; + time: {}; + buffered: {}; + seekTime(value?: number, byPercent?: boolean): void; + $$seek(media: HTMLVideoElement | HTMLAudioElement, value?: number, byPercent?: boolean): void; + $$getAllProperties(property: string): {}; + $$setAllProperties(property: string, value: any): void; + registerElement(elem: HTMLElement): void; + registerMedia(media: HTMLVideoElement | HTMLAudioElement): void; + toggleFullscreen(element: any): void; + isFullscreen(): boolean; + connect(media: HTMLVideoElement | HTMLAudioElement): void; + onCanPlay(id: string): void; + onCanPlayThrough(id: string): void; + onLoadMetadata(id: string): void; + onWait(id: string): void; + onComplete(id: string): void; + onStartPlaying(id: string): void; + onPlay(id: string): void; + onPause(id: string): void; + onPlaybackChange(id: string, rate: string): void; + onTimeUpdate(id: string): void; + onProgress(id: string): void; + onVolumeChange(id: string): void; + onError(id: string): void; +} diff --git a/services/vg-api.js b/services/vg-api.js new file mode 100644 index 00000000..fea837c5 --- /dev/null +++ b/services/vg-api.js @@ -0,0 +1,251 @@ +var api_1 = require('../api'); +var VgAPI = (function () { + function VgAPI() { + this.medias = {}; + api_1.VgFullscreenAPI.init(); + } + VgAPI.prototype.getDefaultMedia = function () { + for (var item in this.medias) { + return this.medias[item]; + } + }; + VgAPI.prototype.getMediaById = function (id) { + var media = this.medias[id]; + if (!id || id === '*') { + media = this; + } + return media; + }; + VgAPI.prototype.play = function () { + for (var id in this.medias) { + this.medias[id].play(); + } + }; + VgAPI.prototype.pause = function () { + for (var id in this.medias) { + this.medias[id].pause(); + } + }; + Object.defineProperty(VgAPI.prototype, "duration", { + get: function () { + return this.$$getAllProperties('duration'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "state", { + get: function () { + return this.$$getAllProperties('state'); + }, + set: function (state) { + this.$$setAllProperties('state', state); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "volume", { + get: function () { + return this.$$getAllProperties('volume'); + }, + set: function (volume) { + this.$$setAllProperties('volume', volume); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "playbackRate", { + get: function () { + return this.$$getAllProperties('playbackRate'); + }, + set: function (rate) { + this.$$setAllProperties('playbackRate', rate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "canPlay", { + get: function () { + return this.$$getAllProperties('canPlay'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "canPlayThrough", { + get: function () { + return this.$$getAllProperties('canPlayThrough'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "isMetadataLoaded", { + get: function () { + return this.$$getAllProperties('isMetadataLoaded'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "isWaiting", { + get: function () { + return this.$$getAllProperties('isWaiting'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "isCompleted", { + get: function () { + return this.$$getAllProperties('isCompleted'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "time", { + get: function () { + return this.$$getAllProperties('time'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VgAPI.prototype, "buffered", { + get: function () { + return this.$$getAllProperties('buffered'); + }, + enumerable: true, + configurable: true + }); + VgAPI.prototype.seekTime = function (value, byPercent) { + if (value === void 0) { value = 0; } + if (byPercent === void 0) { byPercent = false; } + for (var id in this.medias) { + this.$$seek(this.medias[id], value, byPercent); + } + }; + VgAPI.prototype.$$seek = function (media, value, byPercent) { + if (value === void 0) { value = 0; } + if (byPercent === void 0) { byPercent = false; } + var second; + if (byPercent) { + second = value * media.duration / 100; + } + else { + second = value; + } + media.currentTime = second; + }; + VgAPI.prototype.$$getAllProperties = function (property) { + var result = {}; + for (var id in this.medias) { + result[id] = this.medias[id][property]; + } + // If there's only one media element then return the plain value + if (Object.keys(result).length === 1) + result = result[Object.keys(result)[0]]; + return result; + }; + VgAPI.prototype.$$setAllProperties = function (property, value) { + for (var id in this.medias) { + this.medias[id][property] = value; + } + }; + VgAPI.prototype.registerElement = function (elem) { + this.videogularElement = elem; + }; + VgAPI.prototype.registerMedia = function (media) { + var _this = this; + media.time = { + current: 0, + total: 0, + left: 0 + }; + media.buffer = { + end: 0 + }; + media.canPlay = false; + media.canPlayThrough = false; + media.isMetadataLoaded = false; + media.isWaiting = false; + media.isCompleted = false; + media.state = 'pause'; + media.seekTime = function (value, byPercent) { + if (value === void 0) { value = 0; } + if (byPercent === void 0) { byPercent = false; } + _this.$$seek(media, value, byPercent); + }; + this.medias[media.id] = media; + this.connect(media); + }; + // TODO: Add support for mobile devices + VgAPI.prototype.toggleFullscreen = function (element) { + if (!element) + element = this.videogularElement; + if (api_1.VgFullscreenAPI.isFullscreen()) { + api_1.VgFullscreenAPI.exit(); + } + else { + api_1.VgFullscreenAPI.request(element); + } + }; + VgAPI.prototype.isFullscreen = function () { + return api_1.VgFullscreenAPI.isFullscreen(); + }; + VgAPI.prototype.connect = function (media) { + media.addEventListener(api_1.VgEvents.VG_CAN_PLAY, this.onCanPlay.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_CAN_PLAY_THROUGH, this.onCanPlayThrough.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_LOADED_METADATA, this.onLoadMetadata.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_WAITING, this.onWait.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_PROGRESS, this.onProgress.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_ENDED, this.onComplete.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_PLAYING, this.onStartPlaying.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_PLAY, this.onPlay.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_PAUSE, this.onPause.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_PLAYBACK_CHANGE, this.onPlaybackChange.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_TIME_UPDATE, this.onTimeUpdate.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_VOLUME_CHANGE, this.onVolumeChange.bind(this, media.id), false); + media.addEventListener(api_1.VgEvents.VG_ERROR, this.onError.bind(this, media.id), false); + }; + VgAPI.prototype.onCanPlay = function (id) { + this.medias[id].canPlay = true; + }; + VgAPI.prototype.onCanPlayThrough = function (id) { + this.medias[id].canPlayThrough = true; + }; + VgAPI.prototype.onLoadMetadata = function (id) { + this.medias[id].isMetadataLoaded = true; + this.medias[id].time.total = this.medias[id].duration * 1000; + }; + VgAPI.prototype.onWait = function (id) { + this.medias[id].isWaiting = true; + }; + VgAPI.prototype.onComplete = function (id) { + this.medias[id].isCompleted = true; + this.medias[id].state = 'pause'; + }; + VgAPI.prototype.onStartPlaying = function (id) { + this.medias[id].state = 'play'; + }; + VgAPI.prototype.onPlay = function (id) { + this.medias[id].state = 'play'; + }; + VgAPI.prototype.onPause = function (id) { + this.medias[id].state = 'pause'; + }; + VgAPI.prototype.onPlaybackChange = function (id, rate) { + this.medias[id].playbackRate = rate; + }; + VgAPI.prototype.onTimeUpdate = function (id) { + this.medias[id].time.current = this.medias[id].currentTime * 1000; + this.medias[id].time.left = (this.medias[id].duration - this.medias[id].currentTime) * 1000; + this.medias[id].buffer.end = this.medias[id].buffered.end(this.medias[id].buffered.length - 1) * 1000; + }; + VgAPI.prototype.onProgress = function (id) { + this.medias[id].buffer.end = this.medias[id].buffered.end(this.medias[id].buffered.length - 1) * 1000; + }; + VgAPI.prototype.onVolumeChange = function (id) { + //this.medias[id].volume = this.medias[id].volume; + }; + VgAPI.prototype.onError = function (id) { + console.log('error'); + }; + return VgAPI; +})(); +exports.VgAPI = VgAPI; +//# sourceMappingURL=vg-api.js.map \ No newline at end of file diff --git a/services/vg-api.js.map b/services/vg-api.js.map new file mode 100644 index 00000000..19d1e2f0 --- /dev/null +++ b/services/vg-api.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-api.js","sourceRoot":"","sources":["vg-api.ts"],"names":["VgAPI","VgAPI.constructor","VgAPI.getDefaultMedia","VgAPI.getMediaById","VgAPI.play","VgAPI.pause","VgAPI.duration","VgAPI.state","VgAPI.volume","VgAPI.playbackRate","VgAPI.canPlay","VgAPI.canPlayThrough","VgAPI.isMetadataLoaded","VgAPI.isWaiting","VgAPI.isCompleted","VgAPI.time","VgAPI.buffered","VgAPI.seekTime","VgAPI.$$seek","VgAPI.$$getAllProperties","VgAPI.$$setAllProperties","VgAPI.registerElement","VgAPI.registerMedia","VgAPI.toggleFullscreen","VgAPI.isFullscreen","VgAPI.connect","VgAPI.onCanPlay","VgAPI.onCanPlayThrough","VgAPI.onLoadMetadata","VgAPI.onWait","VgAPI.onComplete","VgAPI.onStartPlaying","VgAPI.onPlay","VgAPI.onPause","VgAPI.onPlaybackChange","VgAPI.onTimeUpdate","VgAPI.onProgress","VgAPI.onVolumeChange","VgAPI.onError"],"mappings":"AAAA,oBAAwC,QAAQ,CAAC,CAAA;AAEjD;IAIIA;QAHAC,WAAMA,GAAUA,EAAEA,CAACA;QAIfA,qBAAeA,CAACA,IAAIA,EAAEA,CAACA;IAC3BA,CAACA;IAEDD,+BAAeA,GAAfA;QACIE,GAAGA,CAAC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A,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,MAAMA,CAACA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,QAAQA,CAACA,GAAGA,CAACA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;IAC1GA,CAACA;IAEDnC,0BAAUA,GAAVA,UAAWA,EAASA;QAChBoC,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,MAAMA,CAACA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,QAAQA,CAACA,GAAGA,CAACA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;IAC1GA,CAACA;IAEDpC,8BAAcA,GAAdA,UAAeA,EAASA;QACpBqC,kDAAkDA;IACtDA,CAACA;IAEDrC,uBAAOA,GAAPA,UAAQA,EAASA;QACbsC,OAAOA,CAACA,GAAGA,CAACA,OAAOA,CAACA,CAACA;IACzBA,CAACA;IACLtC,YAACA;AAADA,CAACA,AAzPD,IAyPC;AAzPY,aAAK,QAyPjB,CAAA"} \ No newline at end of file diff --git a/src/services/vg-api.ts b/services/vg-api.ts similarity index 100% rename from src/services/vg-api.ts rename to services/vg-api.ts diff --git a/services/vg-fullscreen-api.d.ts b/services/vg-fullscreen-api.d.ts new file mode 100644 index 00000000..94341f6e --- /dev/null +++ b/services/vg-fullscreen-api.d.ts @@ -0,0 +1,9 @@ +export declare class VgFullscreenAPI { + static polyfill: any; + static onchange: string; + static onerror: string; + static init(): void; + static isFullscreen(): boolean; + static request(elem: any): void; + static exit(): void; +} diff --git a/services/vg-fullscreen-api.js b/services/vg-fullscreen-api.js new file mode 100644 index 00000000..90db85c1 --- /dev/null +++ b/services/vg-fullscreen-api.js @@ -0,0 +1,78 @@ +var VgFullscreenAPI = (function () { + function VgFullscreenAPI() { + } + VgFullscreenAPI.init = function () { + var APIs = { + w3: { + enabled: "fullscreenEnabled", + element: "fullscreenElement", + request: "requestFullscreen", + exit: "exitFullscreen", + onchange: "fullscreenchange", + onerror: "fullscreenerror" + }, + newWebkit: { + enabled: "webkitFullscreenEnabled", + element: "webkitFullscreenElement", + request: "webkitRequestFullscreen", + exit: "webkitExitFullscreen", + onchange: "webkitfullscreenchange", + onerror: "webkitfullscreenerror" + }, + oldWebkit: { + enabled: "webkitIsFullScreen", + element: "webkitCurrentFullScreenElement", + request: "webkitRequestFullScreen", + exit: "webkitCancelFullScreen", + onchange: "webkitfullscreenchange", + onerror: "webkitfullscreenerror" + }, + moz: { + enabled: "mozFullScreen", + element: "mozFullScreenElement", + request: "mozRequestFullScreen", + exit: "mozCancelFullScreen", + onchange: "mozfullscreenchange", + onerror: "mozfullscreenerror" + }, + ios: { + enabled: "webkitFullscreenEnabled", + element: "webkitFullscreenElement", + request: "webkitEnterFullscreen", + exit: "webkitExitFullscreen", + onchange: "webkitfullscreenchange", + onerror: "webkitfullscreenerror" + }, + ms: { + enabled: "msFullscreenEnabled", + element: "msFullscreenElement", + request: "msRequestFullscreen", + exit: "msExitFullscreen", + onchange: "MSFullscreenChange", + onerror: "MSFullscreenError" + } + }; + for (var browser in APIs) { + if (APIs[browser].enabled in document) { + this.polyfill = APIs[browser]; + break; + } + } + if (this.polyfill) { + this.onchange = this.polyfill.onchange; + this.onerror = this.polyfill.onerror; + } + }; + VgFullscreenAPI.isFullscreen = function () { + return (document[this.polyfill.element] != null); + }; + VgFullscreenAPI.request = function (elem) { + elem[this.polyfill.request](); + }; + VgFullscreenAPI.exit = function () { + document[this.polyfill.exit](); + }; + return VgFullscreenAPI; +})(); +exports.VgFullscreenAPI = VgFullscreenAPI; +//# sourceMappingURL=vg-fullscreen-api.js.map \ No newline at end of file diff --git a/services/vg-fullscreen-api.js.map b/services/vg-fullscreen-api.js.map new file mode 100644 index 00000000..6cfd3905 --- /dev/null +++ b/services/vg-fullscreen-api.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-fullscreen-api.js","sourceRoot":"","sources":["vg-fullscreen-api.ts"],"names":["VgFullscreenAPI","VgFullscreenAPI.constructor","VgFullscreenAPI.init","VgFullscreenAPI.isFullscreen","VgFullscreenAPI.request","VgFullscreenAPI.exit"],"mappings":"AAAA;IAAAA;IAiFAC,CAACA;IA5EUD,oBAAIA,GAAXA;QACIE,IAAMA,IAAIA,GAAGA;YACTA,EAAEA,EAAEA;gBACAA,OAAOA,EAAEA,mBAAmBA;gBAC5BA,OAAOA,EAAEA,mBAAmBA;gBAC5BA,OAAOA,EAAEA,mBAAmBA;gBAC5BA,IAAIA,EAAEA,gBAAgBA;gBACtBA,QAAQA,EAAEA,kBAAkBA;gBAC5BA,OAAOA,EAAEA,iBAAiBA;aAC7BA;YACDA,SAASA,EAAEA;gBACPA,OAAOA,EAAEA,yBAAyBA;gBAClCA,OAAOA,EAAEA,yBAAyBA;gBAClCA,OAAOA,EAAEA,yBAAyBA;gBAClCA,IAAIA,EAAEA,sBAAsBA;gBAC5BA,QAAQA,EAAEA,wBAAwBA;gBAClCA,OAAOA,EAAEA,uBAAuBA;aACnCA;YACDA,SAASA,EAAEA;gBACPA,OAAOA,EAAEA,oBAAoBA;gBAC7BA,OAAOA,EAAEA,gCAAgCA;gBACzCA,OAAOA,EAAEA,yBAAyBA;gBAClCA,IAAIA,EAAEA,wBAAwBA;gBAC9BA,QAAQA,EAAEA,wBAAwBA;gBAClCA,OAAOA,EAAEA,uBAAuBA;aACnCA;YACDA,GAAGA,EAAEA;gBACDA,OAAOA,EAAEA,eAAeA;gBACxBA,OAAOA,EAAEA,sBAAsBA;gBAC/BA,OAAOA,EAAEA,sBAAsBA;gBAC/BA,IAAIA,EAAEA,qBAAqBA;gBAC3BA,QAAQA,EAAEA,qBAAqBA;gBAC/BA,OAAOA,EAAEA,oBAAoBA;aAChCA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A,EAAEA,CAACA;IAClCA,CAACA;IAEMJ,oBAAIA,GAAXA;QACIK,QAAQA,CAACA,IAAIA,CAACA,QAAQA,CAACA,IAAIA,CAACA,EAAEA,CAACA;IACnCA,CAACA;IACLL,sBAACA;AAADA,CAACA,AAjFD,IAiFC;AAjFY,uBAAe,kBAiF3B,CAAA"} \ No newline at end of file diff --git a/src/services/vg-fullscreen-api.ts b/services/vg-fullscreen-api.ts similarity index 100% rename from src/services/vg-fullscreen-api.ts rename to services/vg-fullscreen-api.ts diff --git a/src/vg-player/vg-player.scss b/src/vg-player/vg-player.scss deleted file mode 100644 index 6615ec9e..00000000 --- a/src/vg-player/vg-player.scss +++ /dev/null @@ -1,23 +0,0 @@ -@font-face { - font-family: 'videogular'; - src: url('fonts/videogular.eot'); - src: url('fonts/videogular.eot?#iefix') format('embedded-opentype'), - url('fonts/videogular.woff') format('woff'), - url('fonts/videogular.ttf') format('truetype'), - url('fonts/videogular.svg#videogular') format('svg'); - font-weight: normal; - font-style: normal; -} - -:host { - font-family: 'videogular'; - position: relative; - display: flex; - width: 100%; - height: 100%; - - video { - width: 100%; - height: 100%; - } -} diff --git a/tsconfig.json b/tsconfig.json index 842a436f..c0c2def0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,13 @@ { "compilerOptions": { - "target": "es5", - "removeComments": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, + "target": "ES5", "module": "commonjs", - "noImplicitAny": false, - "outDir": ".", - "rootDir": ".", - "sourceMap": false + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "declaration": true, + "noImplicitAny": true }, "files": [ "videogular2.ts" diff --git a/vg-controls/vg-controls.css b/vg-controls/vg-controls.css new file mode 100644 index 00000000..86c2a23d --- /dev/null +++ b/vg-controls/vg-controls.css @@ -0,0 +1,25 @@ +:host { + position: absolute; + display: flex; + width: 100%; + height: 50px; + z-index: 300; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); } + :host vg-time-display { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + justify-content: center; + height: 50px; + width: 60px; + cursor: pointer; + color: white; + line-height: 50px; + pointer-events: none; } + +/*# sourceMappingURL=vg-controls.css.map */ diff --git a/vg-controls/vg-controls.css.map b/vg-controls/vg-controls.css.map new file mode 100644 index 00000000..73236b03 --- /dev/null +++ b/vg-controls/vg-controls.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;EACF,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,CAAC;EACT,gBAAgB,EAAE,kBAAkB;ECPxC,qBAAgB;ICDZ,qBAAqB,EAAE,IAAI;IAC3B,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,IAAI;IAKjB,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,MAAM,EAAE,IAAI;IACZ,KAAK,EDXY,IAAI;ICYrB,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,IAAI;IDbjB,cAAc,EAAE,IAAI", +"sources": ["vg-controls.scss","vg-time-display/vg-time-display.scss","vg-mixins.scss"], +"names": [], +"file": "vg-controls.css" +} \ No newline at end of file diff --git a/vg-controls/vg-controls.d.ts b/vg-controls/vg-controls.d.ts new file mode 100644 index 00000000..771a33bf --- /dev/null +++ b/vg-controls/vg-controls.d.ts @@ -0,0 +1,5 @@ +import { VgAPI } from '../api'; +export declare class VgControls { + API: VgAPI; + constructor(API: VgAPI); +} diff --git a/src/vg-controls/vg-controls.html b/vg-controls/vg-controls.html similarity index 100% rename from src/vg-controls/vg-controls.html rename to vg-controls/vg-controls.html diff --git a/vg-controls/vg-controls.js b/vg-controls/vg-controls.js new file mode 100644 index 00000000..ef58126c --- /dev/null +++ b/vg-controls/vg-controls.js @@ -0,0 +1,32 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../api'); +var VgControls = (function () { + function VgControls(API) { + this.API = API; + } + VgControls = __decorate([ + angular2_1.Component({ + selector: 'vg-controls' + }), + angular2_1.View({ + template: "", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-controls.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgControls); + return VgControls; +})(); +exports.VgControls = VgControls; +//# sourceMappingURL=vg-controls.js.map \ No newline at end of file diff --git a/vg-controls/vg-controls.js.map b/vg-controls/vg-controls.js.map new file mode 100644 index 00000000..dbcb1925 --- /dev/null +++ b/vg-controls/vg-controls.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-controls.js","sourceRoot":"","sources":["vg-controls.ts"],"names":["VgControls","VgControls.constructor"],"mappings":";;;;;;;;;;;AAAA,yBAAiD,mBAAmB,CAAC,CAAA;AAErE,oBAAoB,QAAQ,CAAC,CAAA;AAE7B;IASIA,oBAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;IAE5BA,CAACA;IAXLD;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,aAAaA;SAC1BA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,2BAA2BA;YACrCA,SAASA,EAAEA,CAACA,yDAAyDA,CAACA;YACtEA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;mBAKDA;IAADA,iBAACA;AAADA,CAACA,AAZD,IAYC;AAJY,kBAAU,aAItB,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-controls.scss b/vg-controls/vg-controls.scss similarity index 100% rename from src/vg-controls/vg-controls.scss rename to vg-controls/vg-controls.scss diff --git a/src/vg-controls/vg-controls.ts b/vg-controls/vg-controls.ts similarity index 69% rename from src/vg-controls/vg-controls.ts rename to vg-controls/vg-controls.ts index 31c46b8c..397f1ad3 100644 --- a/src/vg-controls/vg-controls.ts +++ b/vg-controls/vg-controls.ts @@ -6,7 +6,8 @@ import {VgAPI} from '../api'; selector: 'vg-controls' }) @View({ - templateUrl: './vg-controls.html', + template: ``, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-controls.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgControls { diff --git a/vg-controls/vg-fullscreen/vg-fullscreen.css b/vg-controls/vg-fullscreen/vg-fullscreen.css new file mode 100644 index 00000000..01ded046 --- /dev/null +++ b/vg-controls/vg-fullscreen/vg-fullscreen.css @@ -0,0 +1,22 @@ +:host { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + justify-content: center; + height: 50px; + width: 50px; + cursor: pointer; + color: white; + line-height: 50px; } + :host .icon { + pointer-events: none; } + :host .icon.normal:before { + content: "\e007"; } + :host .icon.fullscreen:before { + content: "\e008"; } + +/*# sourceMappingURL=vg-fullscreen.css.map */ diff --git a/vg-controls/vg-fullscreen/vg-fullscreen.css.map b/vg-controls/vg-fullscreen/vg-fullscreen.css.map new file mode 100644 index 00000000..f5b73709 --- /dev/null +++ b/vg-controls/vg-fullscreen/vg-fullscreen.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;ECDF,qBAAqB,EAAE,IAAI;EAC3B,mBAAmB,EAAE,IAAI;EACzB,kBAAkB,EAAE,IAAI;EACxB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,IAAI;EAKjB,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,MAAM;EACvB,MAAM,EAAE,IAAI;EACZ,KAAK,EDXY,IAAI;ECYrB,MAAM,EAAE,OAAO;EACf,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,IAAI;EDZjB,WAAM;IACF,cAAc,EAAE,IAAI;IAEpB,yBAAgB;MACZ,OAAO,EAAE,OAAO;IAGpB,6BAAoB;MAChB,OAAO,EAAE,OAAO", +"sources": ["vg-fullscreen.scss","../vg-mixins.scss"], +"names": [], +"file": "vg-fullscreen.css" +} \ No newline at end of file diff --git a/vg-controls/vg-fullscreen/vg-fullscreen.d.ts b/vg-controls/vg-fullscreen/vg-fullscreen.d.ts new file mode 100644 index 00000000..6bca71d5 --- /dev/null +++ b/vg-controls/vg-fullscreen/vg-fullscreen.d.ts @@ -0,0 +1,10 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../api'; +export declare class VgFullscreen implements OnInit { + API: VgAPI; + target: Object; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + onClick(): void; +} diff --git a/src/vg-controls/vg-fullscreen/vg-fullscreen.html b/vg-controls/vg-fullscreen/vg-fullscreen.html similarity index 100% rename from src/vg-controls/vg-fullscreen/vg-fullscreen.html rename to vg-controls/vg-fullscreen/vg-fullscreen.html diff --git a/vg-controls/vg-fullscreen/vg-fullscreen.js b/vg-controls/vg-fullscreen/vg-fullscreen.js new file mode 100644 index 00000000..55126888 --- /dev/null +++ b/vg-controls/vg-fullscreen/vg-fullscreen.js @@ -0,0 +1,48 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../api'); +var VgFullscreen = (function () { + function VgFullscreen(API) { + this.API = API; + } + VgFullscreen.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgFullscreen.prototype.onClick = function () { + var element = this.target; + if (this.target instanceof api_1.VgAPI) { + element = null; + } + this.API.toggleFullscreen(element); + }; + VgFullscreen = __decorate([ + angular2_1.Component({ + selector: 'vg-fullscreen', + inputs: [ + 'targetId: for' + ], + host: { + '(click)': 'onClick()' + } + }), + angular2_1.View({ + template: "
\n
", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-fullscreen/vg-fullscreen.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgFullscreen); + return VgFullscreen; +})(); +exports.VgFullscreen = VgFullscreen; +//# sourceMappingURL=vg-fullscreen.js.map \ No newline at end of file diff --git a/vg-controls/vg-fullscreen/vg-fullscreen.js.map b/vg-controls/vg-fullscreen/vg-fullscreen.js.map new file mode 100644 index 00000000..f00a8c14 --- /dev/null +++ b/vg-controls/vg-fullscreen/vg-fullscreen.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-fullscreen.js","sourceRoot":"","sources":["vg-fullscreen.ts"],"names":["VgFullscreen","VgFullscreen.constructor","VgFullscreen.onInit","VgFullscreen.onClick"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,WAAW,CAAC,CAAA;AAEhC;IAsBIA,sBAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;IAE5BA,CAACA;IAEDD,6BAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,8BAAOA,GAAPA;QACIG,IAAIA,OAAOA,GAAGA,IAAIA,CAACA,MAAMA,CAACA;QAE1BA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,YAAYA,WAAKA,CAACA,CAACA,CAACA;YAC/BA,OAAOA,GAAGA,IAAIA,CAACA;QACnBA,CAACA;QAEDA,IAAIA,CAACA,GAAGA,CAACA,gBAAgBA,CAACA,OAAOA,CAACA,CAACA;IACvCA,CAACA;IAtCLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,eAAeA;YACzBA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;YACDA,IAAIA,EAAEA;gBACFA,SAASA,EAAEA,WAAWA;aACzBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EACJA,mJAGOA;YACXA,SAASA,EAAEA,CAACA,yEAAyEA,CAACA;YACtFA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;qBAsBDA;IAADA,mBAACA;AAADA,CAACA,AAvCD,IAuCC;AArBY,oBAAY,eAqBxB,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-fullscreen/vg-fullscreen.scss b/vg-controls/vg-fullscreen/vg-fullscreen.scss similarity index 100% rename from src/vg-controls/vg-fullscreen/vg-fullscreen.scss rename to vg-controls/vg-fullscreen/vg-fullscreen.scss diff --git a/src/vg-controls/vg-fullscreen/vg-fullscreen.ts b/vg-controls/vg-fullscreen/vg-fullscreen.ts similarity index 73% rename from src/vg-controls/vg-fullscreen/vg-fullscreen.ts rename to vg-controls/vg-fullscreen/vg-fullscreen.ts index c76b5809..2e6afe81 100644 --- a/src/vg-controls/vg-fullscreen/vg-fullscreen.ts +++ b/vg-controls/vg-fullscreen/vg-fullscreen.ts @@ -12,7 +12,12 @@ import {VgAPI} from '../../api'; } }) @View({ - templateUrl: './vg-fullscreen.html', + template: + `
+
`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-fullscreen/vg-fullscreen.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgFullscreen implements OnInit { diff --git a/src/vg-controls/vg-mixins.scss b/vg-controls/vg-mixins.scss similarity index 100% rename from src/vg-controls/vg-mixins.scss rename to vg-controls/vg-mixins.scss diff --git a/vg-controls/vg-mute/vg-mute.css b/vg-controls/vg-mute/vg-mute.css new file mode 100644 index 00000000..cdbb3364 --- /dev/null +++ b/vg-controls/vg-mute/vg-mute.css @@ -0,0 +1,28 @@ +:host { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + justify-content: center; + height: 50px; + width: 50px; + cursor: pointer; + color: white; + line-height: 50px; } + :host .icon { + pointer-events: none; } + :host .icon.level3:before { + content: "\e002"; } + :host .icon.level2:before { + content: "\e003"; } + :host .icon.level1:before { + content: "\e004"; } + :host .icon.level0:before { + content: "\e005"; } + :host .icon.mute:before { + content: "\e006"; } + +/*# sourceMappingURL=vg-mute.css.map */ diff --git a/vg-controls/vg-mute/vg-mute.css.map b/vg-controls/vg-mute/vg-mute.css.map new file mode 100644 index 00000000..21e29f30 --- /dev/null +++ b/vg-controls/vg-mute/vg-mute.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;ECDF,qBAAqB,EAAE,IAAI;EAC3B,mBAAmB,EAAE,IAAI;EACzB,kBAAkB,EAAE,IAAI;EACxB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,IAAI;EAKjB,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,MAAM;EACvB,MAAM,EAAE,IAAI;EACZ,KAAK,EDXY,IAAI;ECYrB,MAAM,EAAE,OAAO;EACf,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,IAAI;EDZjB,WAAM;IACF,cAAc,EAAE,IAAI;IAEpB,yBAAgB;MACZ,OAAO,EAAE,OAAO;IAGpB,yBAAgB;MACZ,OAAO,EAAE,OAAO;IAGpB,yBAAgB;MACZ,OAAO,EAAE,OAAO;IAGpB,yBAAgB;MACZ,OAAO,EAAE,OAAO;IAGpB,uBAAc;MACV,OAAO,EAAE,OAAO", +"sources": ["vg-mute.scss","../vg-mixins.scss"], +"names": [], +"file": "vg-mute.css" +} \ No newline at end of file diff --git a/vg-controls/vg-mute/vg-mute.d.ts b/vg-controls/vg-mute/vg-mute.d.ts new file mode 100644 index 00000000..11f94322 --- /dev/null +++ b/vg-controls/vg-mute/vg-mute.d.ts @@ -0,0 +1,12 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../api'; +export declare class VgMute implements OnInit { + API: VgAPI; + currentVolume: number; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + onClick(): void; + getVolume(): any; +} diff --git a/src/vg-controls/vg-mute/vg-mute.html b/vg-controls/vg-mute/vg-mute.html similarity index 100% rename from src/vg-controls/vg-mute/vg-mute.html rename to vg-controls/vg-mute/vg-mute.html diff --git a/vg-controls/vg-mute/vg-mute.js b/vg-controls/vg-mute/vg-mute.js new file mode 100644 index 00000000..9fdd4b33 --- /dev/null +++ b/vg-controls/vg-mute/vg-mute.js @@ -0,0 +1,67 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../api'); +var VgMute = (function () { + function VgMute(API) { + this.API = API; + } + VgMute.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + this.currentVolume = this.target.volume; + }; + VgMute.prototype.onClick = function () { + var volume = this.getVolume(); + if (volume === 0) { + this.target.volume = this.currentVolume; + } + else { + this.currentVolume = volume; + this.target.volume = 0; + } + }; + VgMute.prototype.getVolume = function () { + var volume; + var result; + if (this.target.volume instanceof Object) { + volume = 0; + for (var media in this.target.volume) { + volume += this.target.volume[media]; + } + result = (volume / Object.keys(this.target.volume).length); + } + else { + result = this.target.volume; + } + return result; + }; + VgMute = __decorate([ + angular2_1.Component({ + selector: 'vg-mute', + inputs: [ + 'targetId: for' + ], + host: { + '(click)': 'onClick()' + } + }), + angular2_1.View({ + template: "
= 0.75\"\n [class.level2]=\"getVolume() >= 0.5 && getVolume() < 0.75\"\n [class.level1]=\"getVolume() >= 0.25 && getVolume() < 0.5\"\n [class.level0]=\"getVolume() > 0 && getVolume() < 0.25\"\n [class.mute]=\"getVolume() === 0\">\n
", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-mute/vg-mute.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgMute); + return VgMute; +})(); +exports.VgMute = VgMute; +//# sourceMappingURL=vg-mute.js.map \ No newline at end of file diff --git a/vg-controls/vg-mute/vg-mute.js.map b/vg-controls/vg-mute/vg-mute.js.map new file mode 100644 index 00000000..9a1aacba --- /dev/null +++ b/vg-controls/vg-mute/vg-mute.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-mute.js","sourceRoot":"","sources":["vg-mute.ts"],"names":["VgMute","VgMute.constructor","VgMute.onInit","VgMute.onClick","VgMute.getVolume"],"mappings":";;;;;;;;;;;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AAIA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA,MAAMA,CAACA,CAACA;QAC/DA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,MAAMA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,MAAMA,CAACA;QAChCA,CAACA;QAEDA,MAAMA,CAACA,MAAMA,CAACA;IAClBA,CAACA;IAjELJ;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,SAASA;YACnBA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;YACDA,IAAIA,EAAEA;gBACFA,SAASA,EAAEA,WAAWA;aACzBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EACJA,uWAMOA;YACXA,SAASA,EAAEA,CAACA,6DAA6DA,CAACA;YAC1EA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;eA8CDA;IAADA,aAACA;AAADA,CAACA,AAlED,IAkEC;AA7CY,cAAM,SA6ClB,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-mute/vg-mute.scss b/vg-controls/vg-mute/vg-mute.scss similarity index 100% rename from src/vg-controls/vg-mute/vg-mute.scss rename to vg-controls/vg-mute/vg-mute.scss diff --git a/src/vg-controls/vg-mute/vg-mute.ts b/vg-controls/vg-mute/vg-mute.ts similarity index 74% rename from src/vg-controls/vg-mute/vg-mute.ts rename to vg-controls/vg-mute/vg-mute.ts index c2a3cead..aeeadae2 100644 --- a/src/vg-controls/vg-mute/vg-mute.ts +++ b/vg-controls/vg-mute/vg-mute.ts @@ -12,7 +12,15 @@ import {VgAPI} from '../../api'; } }) @View({ - templateUrl: './vg-mute.html', + template: + `
+
`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-mute/vg-mute.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgMute implements OnInit { diff --git a/vg-controls/vg-play-pause/vg-play-pause.css b/vg-controls/vg-play-pause/vg-play-pause.css new file mode 100644 index 00000000..f1e26ab4 --- /dev/null +++ b/vg-controls/vg-play-pause/vg-play-pause.css @@ -0,0 +1,22 @@ +:host { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + justify-content: center; + height: 50px; + width: 50px; + cursor: pointer; + color: white; + line-height: 50px; } + :host .icon { + pointer-events: none; } + :host .icon.play:before { + content: "\e000"; } + :host .icon.pause:before { + content: "\e001"; } + +/*# sourceMappingURL=vg-play-pause.css.map */ diff --git a/vg-controls/vg-play-pause/vg-play-pause.css.map b/vg-controls/vg-play-pause/vg-play-pause.css.map new file mode 100644 index 00000000..3fea1cdc --- /dev/null +++ b/vg-controls/vg-play-pause/vg-play-pause.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;ECDF,qBAAqB,EAAE,IAAI;EAC3B,mBAAmB,EAAE,IAAI;EACzB,kBAAkB,EAAE,IAAI;EACxB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,IAAI;EAKjB,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,MAAM;EACvB,MAAM,EAAE,IAAI;EACZ,KAAK,EDXY,IAAI;ECYrB,MAAM,EAAE,OAAO;EACf,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,IAAI;EDZjB,WAAM;IACF,cAAc,EAAE,IAAI;IAEpB,uBAAc;MACV,OAAO,EAAE,OAAO;IAGpB,wBAAe;MACX,OAAO,EAAE,OAAO", +"sources": ["vg-play-pause.scss","../vg-mixins.scss"], +"names": [], +"file": "vg-play-pause.css" +} \ No newline at end of file diff --git a/vg-controls/vg-play-pause/vg-play-pause.d.ts b/vg-controls/vg-play-pause/vg-play-pause.d.ts new file mode 100644 index 00000000..a2ec4f4f --- /dev/null +++ b/vg-controls/vg-play-pause/vg-play-pause.d.ts @@ -0,0 +1,11 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../api'; +export declare class VgPlayPause implements OnInit { + API: VgAPI; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + onClick(): void; + getState(): any; +} diff --git a/src/vg-controls/vg-play-pause/vg-play-pause.html b/vg-controls/vg-play-pause/vg-play-pause.html similarity index 100% rename from src/vg-controls/vg-play-pause/vg-play-pause.html rename to vg-controls/vg-play-pause/vg-play-pause.html diff --git a/vg-controls/vg-play-pause/vg-play-pause.js b/vg-controls/vg-play-pause/vg-play-pause.js new file mode 100644 index 00000000..a0109030 --- /dev/null +++ b/vg-controls/vg-play-pause/vg-play-pause.js @@ -0,0 +1,68 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../api'); +var VgPlayPause = (function () { + function VgPlayPause(API) { + this.API = API; + } + VgPlayPause.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgPlayPause.prototype.onClick = function () { + var state = this.getState(); + switch (state) { + case 'play': + this.target.pause(); + break; + case 'pause': + this.target.play(); + break; + } + }; + VgPlayPause.prototype.getState = function () { + var state; + if (this.target.state instanceof Object) { + state = 'pause'; + for (var media in this.target.state) { + if (this.target.state[media] === 'play') { + state = 'play'; + break; + } + } + } + else { + state = this.target.state; + } + return state; + }; + VgPlayPause = __decorate([ + angular2_1.Component({ + selector: 'vg-play-pause', + inputs: [ + 'targetId: for' + ], + host: { + '(click)': 'onClick()' + } + }), + angular2_1.View({ + template: "
\n
", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-play-pause/vg-play-pause.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgPlayPause); + return VgPlayPause; +})(); +exports.VgPlayPause = VgPlayPause; +//# sourceMappingURL=vg-play-pause.js.map \ No newline at end of file diff --git a/vg-controls/vg-play-pause/vg-play-pause.js.map b/vg-controls/vg-play-pause/vg-play-pause.js.map new file mode 100644 index 00000000..73c60ffd --- /dev/null +++ b/vg-controls/vg-play-pause/vg-play-pause.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-play-pause.js","sourceRoot":"","sources":["vg-play-pause.ts"],"names":["VgPlayPause","VgPlayPause.constructor","VgPlayPause.onInit","VgPlayPause.onClick","VgPlayPause.getState"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,WAAW,CAAC,CAAA;AAEhC;IAsBIA,qBAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;IAE5BA,CAACA;IAEDD,4BAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,6BAAOA,GAAPA;QACIG,IAAIA,KAAKA,GAAGA,IAAIA,CAACA,QAAQA,EAAEA,CAACA;QAE5BA,MAAMA,CAACA,CAACA,KAAKA,CAACA,CAACA,CAACA;YACZA,KAAKA,MAAMA;gBACPA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA;gBACpBA,KAAKA,CAACA;YAEVA,KAAKA,OAAOA;gBACRA,IAAIA,CAACA,MAAMA,CAACA,IAAIA,EAAEA,CAACA;gBACnBA,KAAKA,CAACA;QACdA,CAACA;IACLA,CAACA;IAEDH,8BAAQA,GAARA;QACII,IAAIA,KAAKA,CAACA;QAEVA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,YAAYA,MAAMA,CAACA,CAACA,CAACA;YACtCA,KAAKA,GAAGA,OAAOA,CAACA;YAEhBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,KAAKA,IAAIA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA;gBAClCA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA,KAAKA,CAACA,KAAKA,MAAMA,CAACA,CAAAA,CAACA;oBACrCA,KAAKA,GAAGA,MAAMA,CAACA;oBACfA,KAAKA,CAACA;gBACVA,CAACA;YACLA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,KAAKA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA;QAC9BA,CAACA;QAEDA,MAAMA,CAACA,KAAKA,CAACA;IACjBA,CAACA;IA9DLJ;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,eAAeA;YACzBA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;YACDA,IAAIA,EAAEA;gBACFA,SAASA,EAAEA,WAAWA;aACzBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EACJA,kJAGOA;YACXA,SAASA,EAAEA,CAACA,yEAAyEA,CAACA;YACtFA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;oBA8CDA;IAADA,kBAACA;AAADA,CAACA,AA/DD,IA+DC;AA7CY,mBAAW,cA6CvB,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-play-pause/vg-play-pause.scss b/vg-controls/vg-play-pause/vg-play-pause.scss similarity index 100% rename from src/vg-controls/vg-play-pause/vg-play-pause.scss rename to vg-controls/vg-play-pause/vg-play-pause.scss diff --git a/src/vg-controls/vg-play-pause/vg-play-pause.ts b/vg-controls/vg-play-pause/vg-play-pause.ts similarity index 82% rename from src/vg-controls/vg-play-pause/vg-play-pause.ts rename to vg-controls/vg-play-pause/vg-play-pause.ts index dfbfb7a2..30d1e67a 100644 --- a/src/vg-controls/vg-play-pause/vg-play-pause.ts +++ b/vg-controls/vg-play-pause/vg-play-pause.ts @@ -12,7 +12,12 @@ import {VgAPI} from '../../api'; } }) @View({ - templateUrl: './vg-play-pause.html', + template: + `
+
`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-play-pause/vg-play-pause.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgPlayPause implements OnInit { diff --git a/vg-controls/vg-playback-button/vg-playback-button.css b/vg-controls/vg-playback-button/vg-playback-button.css new file mode 100644 index 00000000..9b8885c5 --- /dev/null +++ b/vg-controls/vg-playback-button/vg-playback-button.css @@ -0,0 +1,18 @@ +:host { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + justify-content: center; + height: 50px; + width: 50px; + cursor: pointer; + color: white; + line-height: 50px; + width: 50px; + color: white; } + +/*# sourceMappingURL=vg-playback-button.css.map */ diff --git a/vg-controls/vg-playback-button/vg-playback-button.css.map b/vg-controls/vg-playback-button/vg-playback-button.css.map new file mode 100644 index 00000000..9dc50f1d --- /dev/null +++ b/vg-controls/vg-playback-button/vg-playback-button.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;ECDF,qBAAqB,EAAE,IAAI;EAC3B,mBAAmB,EAAE,IAAI;EACzB,kBAAkB,EAAE,IAAI;EACxB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,IAAI;EAKjB,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,MAAM;EACvB,MAAM,EAAE,IAAI;EACZ,KAAK,EDXY,IAAI;ECYrB,MAAM,EAAE,OAAO;EACf,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,IAAI;EDbjB,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK", +"sources": ["vg-playback-button.scss","../vg-mixins.scss"], +"names": [], +"file": "vg-playback-button.css" +} \ No newline at end of file diff --git a/vg-controls/vg-playback-button/vg-playback-button.d.ts b/vg-controls/vg-playback-button/vg-playback-button.d.ts new file mode 100644 index 00000000..69abbb4e --- /dev/null +++ b/vg-controls/vg-playback-button/vg-playback-button.d.ts @@ -0,0 +1,12 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../api'; +export declare class VgPlaybackButton implements OnInit { + API: VgAPI; + playbackValues: Array; + playbackIndex: number; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + onClick(): void; +} diff --git a/src/vg-controls/vg-playback-button/vg-playback-button.html b/vg-controls/vg-playback-button/vg-playback-button.html similarity index 100% rename from src/vg-controls/vg-playback-button/vg-playback-button.html rename to vg-controls/vg-playback-button/vg-playback-button.html diff --git a/vg-controls/vg-playback-button/vg-playback-button.js b/vg-controls/vg-playback-button/vg-playback-button.js new file mode 100644 index 00000000..ce74e9f2 --- /dev/null +++ b/vg-controls/vg-playback-button/vg-playback-button.js @@ -0,0 +1,52 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../api'); +var VgPlaybackButton = (function () { + function VgPlaybackButton(API) { + this.API = API; + this.playbackValues = ['0.5', '1.0', '1.5', '2.0']; + this.playbackIndex = 1; + } + VgPlaybackButton.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgPlaybackButton.prototype.onClick = function () { + this.playbackIndex = ++this.playbackIndex % this.playbackValues.length; + if (this.target instanceof api_1.VgAPI) { + this.target.playbackRate = (this.playbackValues[this.playbackIndex]); + } + else { + this.target.playbackRate[this.targetId] = (this.playbackValues[this.playbackIndex]); + } + }; + VgPlaybackButton = __decorate([ + angular2_1.Component({ + selector: 'vg-playback-button', + inputs: [ + 'targetId: for' + ], + host: { + '(click)': 'onClick()' + } + }), + angular2_1.View({ + template: "{{target.playbackRate}}x", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-playback-button/vg-playback-button.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgPlaybackButton); + return VgPlaybackButton; +})(); +exports.VgPlaybackButton = VgPlaybackButton; +//# sourceMappingURL=vg-playback-button.js.map \ No newline at end of file diff --git a/vg-controls/vg-playback-button/vg-playback-button.js.map b/vg-controls/vg-playback-button/vg-playback-button.js.map new file mode 100644 index 00000000..f3a0cdc9 --- /dev/null +++ b/vg-controls/vg-playback-button/vg-playback-button.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-playback-button.js","sourceRoot":"","sources":["vg-playback-button.ts"],"names":["VgPlaybackButton","VgPlaybackButton.constructor","VgPlaybackButton.onInit","VgPlaybackButton.onClick"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,WAAW,CAAC,CAAA;AAEhC;IAqBIA,0BAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;QACxBA,IAAIA,CAACA,cAAcA,GAAGA,CAACA,KAAKA,EAAEA,KAAKA,EAAEA,KAAKA,EAAEA,KAAKA,CAACA,CAACA;QACnDA,IAAIA,CAACA,aAAaA,GAAGA,CAACA,CAACA;IAC3BA,CAACA;IAEDD,iCAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,kCAAOA,GAAPA;QACIG,IAAIA,CAACA,aAAaA,GAAGA,EAAEA,IAAIA,CAACA,aAAaA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,MAAMA,CAACA;QAEvEA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,YAAYA,WAAKA,CAACA,CAACA,CAACA;YAC/BA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,CAACA,IAAIA,CAACA,cAAcA,CAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA;QACzEA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,GAAGA,CAACA,IAAIA,CAACA,cAAcA,CAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA;QACxFA,CAACA;IACLA,CAACA;IAvCLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,oBAAoBA;YAC9BA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;YACDA,IAAIA,EAAEA;gBACFA,SAASA,EAAEA,WAAWA;aACzBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,0BAA0BA;YACpCA,SAASA,EAAEA,CAACA,mFAAmFA,CAACA;YAChGA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;yBA2BDA;IAADA,uBAACA;AAADA,CAACA,AAxCD,IAwCC;AA1BY,wBAAgB,mBA0B5B,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-playback-button/vg-playback-button.scss b/vg-controls/vg-playback-button/vg-playback-button.scss similarity index 100% rename from src/vg-controls/vg-playback-button/vg-playback-button.scss rename to vg-controls/vg-playback-button/vg-playback-button.scss diff --git a/src/vg-controls/vg-playback-button/vg-playback-button.ts b/vg-controls/vg-playback-button/vg-playback-button.ts similarity index 87% rename from src/vg-controls/vg-playback-button/vg-playback-button.ts rename to vg-controls/vg-playback-button/vg-playback-button.ts index aaaa36b9..33ff7402 100644 --- a/src/vg-controls/vg-playback-button/vg-playback-button.ts +++ b/vg-controls/vg-playback-button/vg-playback-button.ts @@ -12,7 +12,8 @@ import {VgAPI} from '../../api'; } }) @View({ - templateUrl: './vg-playback-button.html', + template: `{{target.playbackRate}}x`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-playback-button/vg-playback-button.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgPlaybackButton implements OnInit { diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css new file mode 100644 index 00000000..5373cf46 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css @@ -0,0 +1,18 @@ +:host { + display: flex; + width: 100%; + height: 5px; + pointer-events: none; + position: absolute; } + :host .background { + background-color: rgba(255, 255, 255, 0.3); } + +vg-controls :host { + position: absolute; + top: calc(50% - 3px); } + vg-controls :host .background { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } + +/*# sourceMappingURL=vg-scrub-bar-buffering-time.css.map */ diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css.map b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css.map new file mode 100644 index 00000000..efee9449 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;EACF,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,GAAG;EACX,cAAc,EAAE,IAAI;EACpB,QAAQ,EAAE,QAAQ;EAElB,iBAAY;IACR,gBAAgB,EAAE,wBAAwB;;AAIlD,iBAAkB;EACd,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,eAAe;EAEpB,6BAAY;ICSZ,qBAAqB,EDRM,GAAG;ICS9B,kBAAkB,EDTS,GAAG;ICU9B,aAAa,EDVc,GAAG", +"sources": ["vg-scrub-bar-buffering-time.scss","../../vg-mixins.scss"], +"names": [], +"file": "vg-scrub-bar-buffering-time.css" +} \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.d.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.d.ts new file mode 100644 index 00000000..750dabfc --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.d.ts @@ -0,0 +1,10 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../../api'; +export declare class VgScrubBarBufferingTime implements OnInit { + API: VgAPI; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + getBufferTime(): string; +} diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.html b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.html similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.html rename to vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.html diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js new file mode 100644 index 00000000..b4b200f1 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js @@ -0,0 +1,45 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../../api'); +var VgScrubBarBufferingTime = (function () { + function VgScrubBarBufferingTime(API) { + this.API = API; + } + VgScrubBarBufferingTime.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgScrubBarBufferingTime.prototype.getBufferTime = function () { + var bufferTime = "0%"; + if (this.target.buffered.length) { + bufferTime = ((this.target.buffer.end / this.target.time.total) * 100) + '%'; + } + return bufferTime; + }; + VgScrubBarBufferingTime = __decorate([ + angular2_1.Component({ + selector: 'vg-scrub-bar-buffering-time', + inputs: [ + 'targetId: for' + ] + }), + angular2_1.View({ + template: "
", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgScrubBarBufferingTime); + return VgScrubBarBufferingTime; +})(); +exports.VgScrubBarBufferingTime = VgScrubBarBufferingTime; +//# sourceMappingURL=vg-scrub-bar-buffering-time.js.map \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js.map b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js.map new file mode 100644 index 00000000..8401162e --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-scrub-bar-buffering-time.js","sourceRoot":"","sources":["vg-scrub-bar-buffering-time.ts"],"names":["VgScrubBarBufferingTime","VgScrubBarBufferingTime.constructor","VgScrubBarBufferingTime.onInit","VgScrubBarBufferingTime.getBufferTime"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,cAAc,CAAC,CAAA;AAEnC;IAeIA,iCAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;IAE5BA,CAACA;IAEDD,wCAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,+CAAaA,GAAbA;QACIG,IAAIA,UAAUA,GAAGA,IAAIA,CAACA;QAEtBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,CAACA;YAC9BA,UAAUA,GAAGA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,MAAMA,CAACA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,GAAGA,CAACA,GAAGA,GAAGA,CAACA;QACjFA,CAACA;QAEDA,MAAMA,CAACA,UAAUA,CAACA;IACtBA,CAACA;IA/BLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,6BAA6BA;YACvCA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,oEAAgEA;YAC1EA,SAASA,EAAEA,CAACA,kHAAkHA,CAACA;YAC/HA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;gCAsBDA;IAADA,8BAACA;AAADA,CAACA,AAhCD,IAgCC;AArBY,+BAAuB,0BAqBnC,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.scss b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.scss similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.scss rename to vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.scss diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts similarity index 77% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts rename to vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts index 0f365074..d3e710e9 100644 --- a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.ts @@ -9,7 +9,8 @@ import {VgAPI} from '../../../api'; ] }) @View({ - templateUrl: './vg-scrub-bar-buffering-time.html', + template: `
`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar-buffering-time/vg-scrub-bar-buffering-time.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgScrubBarBufferingTime implements OnInit { diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css new file mode 100644 index 00000000..50fceaf7 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css @@ -0,0 +1,23 @@ +:host { + display: flex; + width: 100%; + height: 5px; + pointer-events: none; + position: absolute; } + :host .background { + background-color: white; } + +vg-controls :host { + position: absolute; + top: calc(50% - 3px); + background-color: rgba(0, 0, 0, 0.6); + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } + vg-controls :host .background { + border: 1px solid white; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } + +/*# sourceMappingURL=vg-scrub-bar-current-time.css.map */ diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css.map b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css.map new file mode 100644 index 00000000..38ad110f --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAEA,KAAM;EACF,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,GAAG;EACX,cAAc,EAAE,IAAI;EACpB,QAAQ,EAAE,QAAQ;EAElB,iBAAY;IACR,gBAAgB,EAAE,KAAK;;AAI/B,iBAAkB;EACd,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,eAAe;EACpB,gBAAgB,EAAE,kBAAkB;ECUpC,qBAAqB,EDRE,GAAG;ECS1B,kBAAkB,EDTK,GAAG;ECU1B,aAAa,EDVU,GAAG;EAE1B,6BAAY;IACR,MAAM,EAAE,eAAe;ICK3B,qBAAqB,EDJM,GAAG;ICK9B,kBAAkB,EDLS,GAAG;ICM9B,aAAa,EDNc,GAAG", +"sources": ["vg-scrub-bar-current-time.scss","../../vg-mixins.scss"], +"names": [], +"file": "vg-scrub-bar-current-time.css" +} \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.d.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.d.ts new file mode 100644 index 00000000..f9a53091 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.d.ts @@ -0,0 +1,10 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../../api'; +export declare class VgScrubBarCurrentTime implements OnInit { + API: VgAPI; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + getPercentage(): string; +} diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.html b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.html similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.html rename to vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.html diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js new file mode 100644 index 00000000..f486c220 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js @@ -0,0 +1,41 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../../api'); +var VgScrubBarCurrentTime = (function () { + function VgScrubBarCurrentTime(API) { + this.API = API; + } + VgScrubBarCurrentTime.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgScrubBarCurrentTime.prototype.getPercentage = function () { + return ((this.target.time.current * 100 / this.target.time.total)) + '%'; + }; + VgScrubBarCurrentTime = __decorate([ + angular2_1.Component({ + selector: 'vg-scrub-bar-current-time', + inputs: [ + 'targetId: for' + ] + }), + angular2_1.View({ + template: "
", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgScrubBarCurrentTime); + return VgScrubBarCurrentTime; +})(); +exports.VgScrubBarCurrentTime = VgScrubBarCurrentTime; +//# sourceMappingURL=vg-scrub-bar-current-time.js.map \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js.map b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js.map new file mode 100644 index 00000000..19e817b2 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-scrub-bar-current-time.js","sourceRoot":"","sources":["vg-scrub-bar-current-time.ts"],"names":["VgScrubBarCurrentTime","VgScrubBarCurrentTime.constructor","VgScrubBarCurrentTime.onInit","VgScrubBarCurrentTime.getPercentage"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,cAAc,CAAC,CAAA;AAEnC;IAeIA,+BAAmBA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;IAE5BA,CAACA;IAEDD,sCAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,6CAAaA,GAAbA;QACIG,MAAMA,CAACA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA,GAAGA,GAAGA,CAACA;IAC7EA,CAACA;IAzBLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,2BAA2BA;YACrCA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,oEAAgEA;YAC1EA,SAASA,EAAEA,CAACA,8GAA8GA,CAACA;YAC3HA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;8BAgBDA;IAADA,4BAACA;AAADA,CAACA,AA1BD,IA0BC;AAfY,6BAAqB,wBAejC,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.scss b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.scss similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.scss rename to vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.scss diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts similarity index 74% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts rename to vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts index 87930e88..6fb3167e 100644 --- a/src/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.ts @@ -9,7 +9,8 @@ import {VgAPI} from '../../../api'; ] }) @View({ - templateUrl: './vg-scrub-bar-current-time.html', + template: `
`, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar-current-time/vg-scrub-bar-current-time.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgScrubBarCurrentTime implements OnInit { diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar.css b/vg-controls/vg-scrub-bar/vg-scrub-bar.css new file mode 100644 index 00000000..c4f5b47b --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.css @@ -0,0 +1,21 @@ +:host { + position: absolute; + width: 100%; + height: 5px; + bottom: 50px; + margin: 0; + cursor: pointer; + align-items: center; + background: rgba(0, 0, 0, 0.75); + z-index: 250; } + +vg-controls :host { + position: relative; + bottom: initial; + background: initial; + height: 50px; + flex-grow: 1; + flex-basis: 0; + margin: 0 10px; } + +/*# sourceMappingURL=vg-scrub-bar.css.map */ diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar.css.map b/vg-controls/vg-scrub-bar/vg-scrub-bar.css.map new file mode 100644 index 00000000..55fd007c --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAAA,KAAM;EACF,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,GAAG;EACX,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,CAAC;EACT,MAAM,EAAE,OAAO;EACf,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,mBAAmB;EAC/B,OAAO,EAAE,GAAG;;AAGhB,iBAAkB;EACd,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,OAAO;EACf,UAAU,EAAE,OAAO;EAEnB,MAAM,EAAE,IAAI;EACZ,SAAS,EAAE,CAAC;EACZ,UAAU,EAAE,CAAC;EACb,MAAM,EAAE,MAAM", +"sources": ["vg-scrub-bar.scss"], +"names": [], +"file": "vg-scrub-bar.css" +} \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar.d.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar.d.ts new file mode 100644 index 00000000..811050a7 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.d.ts @@ -0,0 +1,11 @@ +import { ElementRef, OnInit } from 'angular2/angular2'; +import { VgAPI } from '../../api'; +export declare class VgScrubBar implements OnInit { + API: VgAPI; + elem: any; + target: any; + targetId: string; + constructor(ref: ElementRef, API: VgAPI); + onInit(): void; + onMouseDownScrubBar($event: any): void; +} diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar.html b/vg-controls/vg-scrub-bar/vg-scrub-bar.html similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar.html rename to vg-controls/vg-scrub-bar/vg-scrub-bar.html diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar.js b/vg-controls/vg-scrub-bar/vg-scrub-bar.js new file mode 100644 index 00000000..4a368f33 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.js @@ -0,0 +1,46 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../../api'); +var VgScrubBar = (function () { + function VgScrubBar(ref, API) { + this.API = API; + this.elem = ref.nativeElement; + } + VgScrubBar.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgScrubBar.prototype.onMouseDownScrubBar = function ($event) { + var percentage = $event.offsetX * 100 / this.elem.scrollWidth; + this.target.seekTime(percentage, true); + }; + VgScrubBar = __decorate([ + angular2_1.Component({ + selector: 'vg-scrub-bar', + inputs: [ + 'targetId: for' + ], + host: { + '(mousedown)': 'onMouseDownScrubBar($event)' + } + }), + angular2_1.View({ + template: "", + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [angular2_1.ElementRef, api_1.VgAPI]) + ], VgScrubBar); + return VgScrubBar; +})(); +exports.VgScrubBar = VgScrubBar; +//# sourceMappingURL=vg-scrub-bar.js.map \ No newline at end of file diff --git a/vg-controls/vg-scrub-bar/vg-scrub-bar.js.map b/vg-controls/vg-scrub-bar/vg-scrub-bar.js.map new file mode 100644 index 00000000..58590540 --- /dev/null +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-scrub-bar.js","sourceRoot":"","sources":["vg-scrub-bar.ts"],"names":["VgScrubBar","VgScrubBar.constructor","VgScrubBar.onInit","VgScrubBar.onMouseDownScrubBar"],"mappings":";;;;;;;;;;;AAAA,yBAAqE,mBAAmB,CAAC,CAAA;AAEzF,oBAAoB,WAAW,CAAC,CAAA;AAEhC;IAmBIA,oBAAYA,GAAcA,EAASA,GAASA;QAATC,QAAGA,GAAHA,GAAGA,CAAMA;QACxCA,IAAIA,CAACA,IAAIA,GAAGA,GAAGA,CAACA,aAAaA,CAACA;IAClCA,CAACA;IAEDD,2BAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,wCAAmBA,GAAnBA,UAAoBA,MAAMA;QACtBG,IAAIA,UAAUA,GAAGA,MAAMA,CAACA,OAAOA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,WAAWA,CAACA;QAE9DA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,CAACA,UAAUA,EAAEA,IAAIA,CAACA,CAACA;IAC3CA,CAACA;IA/BLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,cAAcA;YACxBA,MAAMA,EAAEA;gBACJA,eAAeA;aAClBA;YACDA,IAAIA,EAAEA;gBACFA,aAAaA,EAAEA,6BAA6BA;aAC/CA;SACJA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,2BAA2BA;YACrCA,SAASA,EAAEA,CAACA,uEAAuEA,CAACA;YACpFA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;mBAmBDA;IAADA,iBAACA;AAADA,CAACA,AAhCD,IAgCC;AAlBY,kBAAU,aAkBtB,CAAA"} \ No newline at end of file diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar.scss b/vg-controls/vg-scrub-bar/vg-scrub-bar.scss similarity index 100% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar.scss rename to vg-controls/vg-scrub-bar/vg-scrub-bar.scss diff --git a/src/vg-controls/vg-scrub-bar/vg-scrub-bar.ts b/vg-controls/vg-scrub-bar/vg-scrub-bar.ts similarity index 85% rename from src/vg-controls/vg-scrub-bar/vg-scrub-bar.ts rename to vg-controls/vg-scrub-bar/vg-scrub-bar.ts index a5797460..b68a3ad8 100644 --- a/src/vg-controls/vg-scrub-bar/vg-scrub-bar.ts +++ b/vg-controls/vg-scrub-bar/vg-scrub-bar.ts @@ -12,7 +12,8 @@ import {VgAPI} from '../../api'; } }) @View({ - templateUrl: './vg-scrub-bar.html', + template: ``, + styleUrls: ['../node_modules/videogular2/vg-controls/vg-scrub-bar/vg-scrub-bar.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgScrubBar implements OnInit { diff --git a/src/vg-controls/vg-time-display/vg-time-display.scss b/vg-controls/vg-time-display/vg-time-display.scss similarity index 100% rename from src/vg-controls/vg-time-display/vg-time-display.scss rename to vg-controls/vg-time-display/vg-time-display.scss diff --git a/vg-overlay-play/vg-overlay-play.css b/vg-overlay-play/vg-overlay-play.css new file mode 100644 index 00000000..14e4cd13 --- /dev/null +++ b/vg-overlay-play/vg-overlay-play.css @@ -0,0 +1,30 @@ +.vg-overlay-play { + transition: all 0.5s; + cursor: pointer; + position: absolute; + display: block; + color: white; + width: 100%; + height: 100%; + z-index: 200; + font-size: 80px; + filter: alpha(opacity=60); + opacity: 0.6; } + .vg-overlay-play .overlay-play-container.play { + pointer-events: none; + width: 100%; + height: 100%; + position: absolute; + display: flex; + align-items: center; + justify-content: center; } + .vg-overlay-play .overlay-play-container.play:before { + transition: all 0.5s; + content: "\e000"; } + .vg-overlay-play:hover { + filter: alpha(opacity=100); + opacity: 1; } + .vg-overlay-play:hover .overlay-play-container.play:before { + transform: scale(1.2); } + +/*# sourceMappingURL=vg-overlay-play.css.map */ diff --git a/vg-overlay-play/vg-overlay-play.css.map b/vg-overlay-play/vg-overlay-play.css.map new file mode 100644 index 00000000..f649aba9 --- /dev/null +++ b/vg-overlay-play/vg-overlay-play.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAAA,gBAAiB;EACf,UAAU,EAAE,QAAQ;EACpB,MAAM,EAAE,OAAO;EACf,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,KAAK;EACZ,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,GAAG;EACZ,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,iBAAiB;EACzB,OAAO,EAAE,GAAG;EAEZ,6CAA6B;IAG3B,cAAc,EAAE,IAAI;IACpB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,MAAM;IAEvB,oDAAS;MACP,UAAU,EAAE,QAAQ;MACpB,OAAO,EAAE,OAAO;EAIpB,sBAAQ;IACN,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,CAAC;IAEV,0DAAmC;MACjC,SAAS,EAAE,UAAU", +"sources": ["vg-overlay-play.scss"], +"names": [], +"file": "vg-overlay-play.css" +} \ No newline at end of file diff --git a/vg-overlay-play/vg-overlay-play.d.ts b/vg-overlay-play/vg-overlay-play.d.ts new file mode 100644 index 00000000..b613bb85 --- /dev/null +++ b/vg-overlay-play/vg-overlay-play.d.ts @@ -0,0 +1,11 @@ +import { OnInit } from 'angular2/angular2'; +import { VgAPI } from '../api'; +export declare class VgOverlayPlay implements OnInit { + API: VgAPI; + target: any; + targetId: string; + constructor(API: VgAPI); + onInit(): void; + onClick(): void; + getState(): any; +} diff --git a/src/vg-overlay-play/vg-overlay-play.html b/vg-overlay-play/vg-overlay-play.html similarity index 100% rename from src/vg-overlay-play/vg-overlay-play.html rename to vg-overlay-play/vg-overlay-play.html diff --git a/vg-overlay-play/vg-overlay-play.js b/vg-overlay-play/vg-overlay-play.js new file mode 100644 index 00000000..e61e029c --- /dev/null +++ b/vg-overlay-play/vg-overlay-play.js @@ -0,0 +1,69 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../api'); +var VgOverlayPlay = (function () { + function VgOverlayPlay(API) { + this.API = API; + } + VgOverlayPlay.prototype.onInit = function () { + this.target = this.API.getMediaById(this.targetId); + }; + VgOverlayPlay.prototype.onClick = function () { + var state = this.getState(); + switch (state) { + case 'play': + this.target.pause(); + break; + case 'pause': + this.target.play(); + break; + } + }; + VgOverlayPlay.prototype.getState = function () { + var state; + if (this.target.state instanceof Array) { + state = 'pause'; + for (var i = 0, l = this.target.state.length; i < l; i++) { + if (this.target.state[i] === 'play') { + state = 'play'; + break; + } + } + } + else { + state = this.target.state; + } + return state; + }; + VgOverlayPlay = __decorate([ + angular2_1.Component({ + selector: 'vg-overlay-play', + inputs: [ + 'targetId: for' + ], + host: { + '(click)': 'onClick()', + 'class': 'vg-overlay-play' + } + }), + angular2_1.View({ + template: "
\n
\n
\n
", + styleUrls: ['../node_modules/videogular2/vg-overlay-play/vg-overlay-play.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [api_1.VgAPI]) + ], VgOverlayPlay); + return VgOverlayPlay; +})(); +exports.VgOverlayPlay = VgOverlayPlay; +//# sourceMappingURL=vg-overlay-play.js.map \ No newline at end of file diff --git a/vg-overlay-play/vg-overlay-play.js.map b/vg-overlay-play/vg-overlay-play.js.map new file mode 100644 index 00000000..a02120ba --- /dev/null +++ b/vg-overlay-play/vg-overlay-play.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-overlay-play.js","sourceRoot":"","sources":["vg-overlay-play.ts"],"names":["VgOverlayPlay","VgOverlayPlay.constructor","VgOverlayPlay.onInit","VgOverlayPlay.onClick","VgOverlayPlay.getState"],"mappings":";;;;;;;;;;;AAAA,yBAAyD,mBAAmB,CAAC,CAAA;AAE7E,oBAAoB,QAAQ,CAAC,CAAA;AAE7B;IAyBIA,uBAAmBA,GAAUA;QAAVC,QAAGA,GAAHA,GAAGA,CAAOA;IAE7BA,CAACA;IAEDD,8BAAMA,GAANA;QACIE,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IACvDA,CAACA;IAEDF,+BAAOA,GAAPA;QACIG,IAAIA,KAAKA,GAAGA,IAAIA,CAACA,QAAQA,EAAEA,CAACA;QAE5BA,MAAMA,CAACA,CAACA,KAAKA,CAACA,CAACA,CAAC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A,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;sBA6CDA;IAADA,oBAACA;AAADA,CAACA,AAjED,IAiEC;AA5CY,qBAAa,gBA4CzB,CAAA"} \ No newline at end of file diff --git a/src/vg-overlay-play/vg-overlay-play.scss b/vg-overlay-play/vg-overlay-play.scss similarity index 100% rename from src/vg-overlay-play/vg-overlay-play.scss rename to vg-overlay-play/vg-overlay-play.scss diff --git a/src/vg-overlay-play/vg-overlay-play.ts b/vg-overlay-play/vg-overlay-play.ts similarity index 82% rename from src/vg-overlay-play/vg-overlay-play.ts rename to vg-overlay-play/vg-overlay-play.ts index 21379757..68948907 100644 --- a/src/vg-overlay-play/vg-overlay-play.ts +++ b/vg-overlay-play/vg-overlay-play.ts @@ -13,7 +13,14 @@ import {VgAPI} from '../api'; } }) @View({ - templateUrl: './vg-overlay-play.html', + + template: + `
+
+
+
`, + styleUrls: ['../node_modules/videogular2/vg-overlay-play/vg-overlay-play.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgOverlayPlay implements OnInit { diff --git a/src/vg-player/fonts/videogular.dev.svg b/vg-player/fonts/videogular.dev.svg similarity index 100% rename from src/vg-player/fonts/videogular.dev.svg rename to vg-player/fonts/videogular.dev.svg diff --git a/src/vg-player/fonts/videogular.eot b/vg-player/fonts/videogular.eot similarity index 100% rename from src/vg-player/fonts/videogular.eot rename to vg-player/fonts/videogular.eot diff --git a/src/vg-player/fonts/videogular.svg b/vg-player/fonts/videogular.svg similarity index 100% rename from src/vg-player/fonts/videogular.svg rename to vg-player/fonts/videogular.svg diff --git a/src/vg-player/fonts/videogular.ttf b/vg-player/fonts/videogular.ttf similarity index 100% rename from src/vg-player/fonts/videogular.ttf rename to vg-player/fonts/videogular.ttf diff --git a/src/vg-player/fonts/videogular.woff b/vg-player/fonts/videogular.woff similarity index 100% rename from src/vg-player/fonts/videogular.woff rename to vg-player/fonts/videogular.woff diff --git a/vg-player/vg-player.css b/vg-player/vg-player.css new file mode 100644 index 00000000..ffd7cf04 --- /dev/null +++ b/vg-player/vg-player.css @@ -0,0 +1,17 @@ +@font-face { + font-family: 'videogular'; + src: url("../node_modules/videogular2/vg-player/fonts/videogular.eot"); + src: url("../node_modules/videogular2/vg-player/fonts/videogular.eot?#iefix") format("embedded-opentype"), url("../node_modules/videogular2/vg-player/fonts/videogular.woff") format("woff"), url("../node_modules/videogular2/vg-player/fonts/videogular.ttf") format("truetype"), url("../node_modules/videogular2/vg-player/fonts/videogular.svg#videogular") format("svg"); + font-weight: normal; + font-style: normal; } +:host { + font-family: 'videogular'; + position: relative; + display: flex; + width: 100%; + height: 100%; } + :host video { + width: 100%; + height: 100%; } + +/*# sourceMappingURL=vg-player.css.map */ diff --git a/vg-player/vg-player.css.map b/vg-player/vg-player.css.map new file mode 100644 index 00000000..c30a0f8e --- /dev/null +++ b/vg-player/vg-player.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAAA,UASC;EARC,WAAW,EAAE,YAAY;EACzB,GAAG,EAAE,iEAAiE;EACtE,GAAG,EAAE,yWAAoG;EAIzG,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGpB,KAAM;EACJ,WAAW,EAAE,YAAY;EACzB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EAEZ,WAAM;IACJ,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI", +"sources": ["vg-player.scss"], +"names": [], +"file": "vg-player.css" +} \ No newline at end of file diff --git a/vg-player/vg-player.d.ts b/vg-player/vg-player.d.ts new file mode 100644 index 00000000..2c45f7d7 --- /dev/null +++ b/vg-player/vg-player.d.ts @@ -0,0 +1,11 @@ +import { EventEmitter, ElementRef, OnInit } from 'angular2/angular2'; +import { VgAPI } from '../api'; +export declare class VgPlayer implements OnInit { + elem: HTMLElement; + API: VgAPI; + onPlayerReady: EventEmitter; + onMediaReady: EventEmitter; + constructor(ref: ElementRef, API: VgAPI); + onInit(): void; + onVgMediaReady(event: any): void; +} diff --git a/src/vg-player/vg-player.html b/vg-player/vg-player.html similarity index 100% rename from src/vg-player/vg-player.html rename to vg-player/vg-player.html diff --git a/vg-player/vg-player.js b/vg-player/vg-player.js new file mode 100644 index 00000000..faba0b4f --- /dev/null +++ b/vg-player/vg-player.js @@ -0,0 +1,51 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var angular2_1 = require('angular2/angular2'); +var api_1 = require('../api'); +var VgPlayer = (function () { + function VgPlayer(ref, API) { + this.onPlayerReady = new angular2_1.EventEmitter(); + this.onMediaReady = new angular2_1.EventEmitter(); + this.API = API; + this.elem = ref.nativeElement; + this.API.registerElement(this.elem); + var slice = Array.prototype.slice; + var videos = slice.call(this.elem.querySelectorAll("video")); + var audios = slice.call(this.elem.querySelectorAll("audio")); + var medias = videos.concat(audios); + for (var i = 0, l = medias.length; i < l; i++) { + this.API.registerMedia(medias[i]); + } + } + VgPlayer.prototype.onInit = function () { + this.onPlayerReady.next(this.API); + }; + VgPlayer.prototype.onVgMediaReady = function (event) { + this.onMediaReady.next(this.API); + }; + VgPlayer = __decorate([ + angular2_1.Component({ + selector: 'vg-player', + bindings: [api_1.VgAPI], + outputs: ['onPlayerReady', 'onMediaReady'] + }), + angular2_1.View({ + template: "", + styleUrls: ['../node_modules/videogular2/vg-player/vg-player.css'], + encapsulation: angular2_1.ViewEncapsulation.Emulated + }), + __metadata('design:paramtypes', [angular2_1.ElementRef, api_1.VgAPI]) + ], VgPlayer); + return VgPlayer; +})(); +exports.VgPlayer = VgPlayer; +//# sourceMappingURL=vg-player.js.map \ No newline at end of file diff --git a/vg-player/vg-player.js.map b/vg-player/vg-player.js.map new file mode 100644 index 00000000..0ef839d8 --- /dev/null +++ b/vg-player/vg-player.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vg-player.js","sourceRoot":"","sources":["vg-player.ts"],"names":["VgPlayer","VgPlayer.constructor","VgPlayer.onInit","VgPlayer.onVgMediaReady"],"mappings":";;;;;;;;;;;AAAA,yBAA8F,mBAAmB,CAAC,CAAA;AAElH,oBAAoB,QAAQ,CAAC,CAAA;AAE7B;IAiBIA,kBAAYA,GAAcA,EAAEA,GAASA;QAHrCC,kBAAaA,GAAgBA,IAAIA,uBAAYA,EAAEA,CAACA;QAChDA,iBAAYA,GAAgBA,IAAIA,uBAAYA,EAAEA,CAACA;QAG3CA,IAAIA,CAACA,GAAGA,GAAGA,GAAGA,CAACA;QACfA,IAAIA,CAACA,IAAIA,GAAGA,GAAGA,CAACA,aAAaA,CAACA;QAE9BA,IAAIA,CAACA,GAAGA,CAACA,eAAeA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA;QAEpCA,IAAIA,KAAKA,GAAYA,KAAKA,CAACA,SAASA,CAACA,KAAKA,CAACA;QAC3CA,IAAIA,MAAMA,GAA2BA,KAAKA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,gBAAgBA,CAACA,OAAOA,CAACA,CAACA,CAACA;QACrFA,IAAIA,MAAMA,GAA2BA,KAAKA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,gBAAgBA,CAACA,OAAOA,CAACA,CAACA,CAACA;QACrFA,IAAIA,MAAMA,GAA4CA,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA;QAE5EA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAACA,CAACA,EAAEA,CAACA,GAACA,MAAMA,CAACA,MAAMA,EAAEA,CAACA,GAACA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YACtCA,IAAIA,CAACA,GAAGA,CAACA,aAAaA,CAACA,MAAMA,CAACA,CAACA,CAACA,CAACA,CAACA;QACtCA,CAACA;IACLA,CAACA;IAEDD,yBAAMA,GAANA;QACIE,IAAIA,CAACA,aAAaA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACtCA,CAACA;IAEDF,iCAAcA,GAAdA,UAAeA,KAAKA;QAChBG,IAAIA,CAACA,YAAYA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACrCA,CAACA;IAvCLH;QAACA,oBAASA,CAACA;YACPA,QAAQA,EAAEA,WAAWA;YACrBA,QAAQA,EAAEA,CAACA,WAAKA,CAACA;YACjBA,OAAOA,EAAEA,CAACA,eAAeA,EAAEA,cAAcA,CAACA;SAC7CA,CAACA;QACDA,eAAIA,CAACA;YACFA,QAAQA,EAAEA,2BAA2BA;YACrCA,SAASA,EAAEA,CAACA,qDAAqDA,CAACA;YAClEA,aAAaA,EAAEA,4BAAiBA,CAACA,QAAQA;SAC5CA,CAACA;;iBA+BDA;IAADA,eAACA;AAADA,CAACA,AAxCD,IAwCC;AA9BY,gBAAQ,WA8BpB,CAAA"} \ No newline at end of file diff --git a/vg-player/vg-player.scss b/vg-player/vg-player.scss new file mode 100644 index 00000000..0cc62d68 --- /dev/null +++ b/vg-player/vg-player.scss @@ -0,0 +1,23 @@ +@font-face { + font-family: 'videogular'; + src: url('../node_modules/videogular2/vg-player/fonts/videogular.eot'); + src: url('../node_modules/videogular2/vg-player/fonts/videogular.eot?#iefix') format('embedded-opentype'), + url('../node_modules/videogular2/vg-player/fonts/videogular.woff') format('woff'), + url('../node_modules/videogular2/vg-player/fonts/videogular.ttf') format('truetype'), + url('../node_modules/videogular2/vg-player/fonts/videogular.svg#videogular') format('svg'); + font-weight: normal; + font-style: normal; +} + +:host { + font-family: 'videogular'; + position: relative; + display: flex; + width: 100%; + height: 100%; + + video { + width: 100%; + height: 100%; + } +} diff --git a/src/vg-player/vg-player.ts b/vg-player/vg-player.ts similarity index 91% rename from src/vg-player/vg-player.ts rename to vg-player/vg-player.ts index 4c547e37..42fc81d5 100644 --- a/src/vg-player/vg-player.ts +++ b/vg-player/vg-player.ts @@ -8,8 +8,8 @@ import {VgAPI} from '../api'; outputs: ['onPlayerReady', 'onMediaReady'] }) @View({ - templateUrl: './vg-player.html', - styleUrls: ['./vg-player.css'], + template: ``, + styleUrls: ['../node_modules/videogular2/vg-player/vg-player.css'], encapsulation: ViewEncapsulation.Emulated }) export class VgPlayer implements OnInit { diff --git a/videogular2.d.ts b/videogular2.d.ts index 5c34b01e..3aedc01a 100644 --- a/videogular2.d.ts +++ b/videogular2.d.ts @@ -1,3 +1,3 @@ -export * from './src/api'; -export * from './src/player'; -export * from './src/plugins'; \ No newline at end of file +export * from './player'; +export * from './api'; +export * from './plugins'; diff --git a/videogular2.ts b/videogular2.ts index 5c34b01e..94118b86 100644 --- a/videogular2.ts +++ b/videogular2.ts @@ -1,3 +1,3 @@ -export * from './src/api'; -export * from './src/player'; -export * from './src/plugins'; \ No newline at end of file +export * from './player'; +export * from './api'; +export * from './plugins'; \ No newline at end of file