diff --git a/dist/media-events.js b/dist/media-events.js index 91eb242..1be6788 100644 --- a/dist/media-events.js +++ b/dist/media-events.js @@ -1,4 +1,14 @@ -/******/ (function(modules) { // webpackBootstrap +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; + } +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ @@ -50,19 +60,23 @@ var _evalService2 = _interopRequireDefault(_evalService); - var _loadedmetadata = __webpack_require__(2); + var _loadedmetadata = __webpack_require__(3); var _loadedmetadata2 = _interopRequireDefault(_loadedmetadata); - var _progress = __webpack_require__(5); + var _progress = __webpack_require__(6); var _progress2 = _interopRequireDefault(_progress); - var _play = __webpack_require__(4); + var _ended = __webpack_require__(2); + + var _ended2 = _interopRequireDefault(_ended); + + var _play = __webpack_require__(5); var _play2 = _interopRequireDefault(_play); - var _pause = __webpack_require__(3); + var _pause = __webpack_require__(4); var _pause2 = _interopRequireDefault(_pause); @@ -70,7 +84,7 @@ var MODULE_NAME = 'media-events'; - angular.module(MODULE_NAME, []).service(_evalService2.default.name, _evalService2.default.main).directive(_loadedmetadata2.default.name, _loadedmetadata2.default.main).directive(_progress2.default.name, _progress2.default.main).directive(_play2.default.name, _play2.default.main).directive(_pause2.default.name, _pause2.default.main); + angular.module(MODULE_NAME, []).service(_evalService2.default.name, _evalService2.default.main).directive(_loadedmetadata2.default.name, _loadedmetadata2.default.main).directive(_progress2.default.name, _progress2.default.main).directive(_ended2.default.name, _ended2.default.main).directive(_play2.default.name, _play2.default.main).directive(_pause2.default.name, _pause2.default.main); module.exports = MODULE_NAME; @@ -137,6 +151,45 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var ENDED_DIRECTIVE_NAME = 'onEnded'; + + var EndedDirective = function EndedDirective(evalService) { + return { + restrict: 'A', + scope: true, + link: function link(scope, element, attrs) { + element.on('ended', function (event) { + evalService.scopeEval({ + scope: scope, + fn: attrs[ENDED_DIRECTIVE_NAME], + $event: event + }); + }); + } + }; + }; + + exports.default = { + name: ENDED_DIRECTIVE_NAME, + main: [_evalService2.default.name, EndedDirective] + }; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _evalService = __webpack_require__(1); + + var _evalService2 = _interopRequireDefault(_evalService); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var LOADED_METADATA_DIRECTIVE_NAME = 'onLoadedMetadata'; var LoadedMetadataDirective = function LoadedMetadataDirective(evalService) { @@ -167,7 +220,7 @@ }; /***/ }, -/* 3 */ +/* 4 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -206,7 +259,7 @@ }; /***/ }, -/* 4 */ +/* 5 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -245,7 +298,7 @@ }; /***/ }, -/* 5 */ +/* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -289,5 +342,7 @@ }; /***/ } -/******/ ]); +/******/ ]) +}); +; //# sourceMappingURL=media-events.js.map \ No newline at end of file diff --git a/dist/media-events.js.map b/dist/media-events.js.map index 9dd801a..b352e02 100644 --- a/dist/media-events.js.map +++ b/dist/media-events.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap adf7e84f77c8e8a6c227","webpack:///./src/_module.js","webpack:///./src/eval-service.js","webpack:///./src/loadedmetadata.js","webpack:///./src/pause.js","webpack:///./src/play.js","webpack:///./src/progress.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;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pBf;;;;;;AAEA;;;;;;AAEA,KAAM,0BAA0B,YAAhC;;AAEA,KAAM,oBAAoB,SAApB,iBAAoB,CAAC,WAAD;AAAA,YAAkB;AACxC,mBAAU,GAD8B;AAExC,gBAAO,IAFiC;AAGxC,aAHwC,gBAGnC,KAHmC,EAG5B,OAH4B,EAGnB,KAHmB,EAGZ;AACxB,qBAAQ,EAAR,CAAW,UAAX,EAAuB,UAAS,KAAT,EAAgB;AACnC,qBAAI,SAAS;AACT,+BAAU,KAAK;AADN,kBAAb;;AAIA,6BAAY,SAAZ,CAAsB;AAClB,4BAAO,KADW;AAElB,yBAAI,MAAM,uBAAN,CAFc;AAGlB,6BAAQ,KAHU;AAIlB,4BAAO;AAJW,kBAAtB;AAMH,cAXD;AAYH;AAhBuC,MAAlB;AAAA,EAA1B;;mBAmBe;AACX,WAAM,uBADK;AAEX,WAAM,CACF,sBAAY,IADV,EAEF,iBAFE;AAFK,E","file":"media-events.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap adf7e84f77c8e8a6c227\n **/","'use strict';\n\nconst MODULE_NAME = 'media-events';\n\nimport EvalService from './eval-service';\nimport LoadedMetadata from './loadedmetadata';\nimport Progress from './progress';\nimport Play from './play';\nimport Pause from './pause';\n\nangular\n .module(MODULE_NAME, [])\n .service(EvalService.name, EvalService.main)\n .directive(LoadedMetadata.name, LoadedMetadata.main)\n .directive(Progress.name, Progress.main)\n .directive(Play.name, Play.main)\n .directive(Pause.name, Pause.main);\n\nmodule.exports = MODULE_NAME;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/_module.js\n **/","'use strict';\n\nconst EVAL_SERVICE_NAME = 'eval-service';\n\nclass EvalService {\n scopeEval(options = {}) {\n var scope = options.scope;\n var locals = {\n $event: options.$event\n };\n\n if(options.attrs) {\n locals.attrs = options.attrs;\n }\n\n scope.$eval(options.fn, locals);\n }\n}\n\nexport default {\n name: EVAL_SERVICE_NAME,\n main: EvalService\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/eval-service.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst LOADED_METADATA_DIRECTIVE_NAME = 'onLoadedMetadata';\n\nconst LoadedMetadataDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('loadedmetadata', function(event) {\n var locals = {\n width: this.videoWidth,\n height: this.videoHeight\n };\n\n evalService.scopeEval({\n scope: scope,\n fn: attrs[LOADED_METADATA_DIRECTIVE_NAME],\n $event: event,\n attrs: locals\n });\n });\n }\n});\n\nexport default {\n name: LOADED_METADATA_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n LoadedMetadataDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/loadedmetadata.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PAUSE_DIRECTIVE_NAME = 'onPause';\n\nconst PauseDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('pause', (event) => {\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PAUSE_DIRECTIVE_NAME],\n $event: event\n });\n });\n }\n});\n\nexport default {\n name: PAUSE_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n PauseDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/pause.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PLAY_DIRECTIVE_NAME = 'onPlay';\n\nconst PlayDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('play', (event) => {\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PLAY_DIRECTIVE_NAME],\n $event: event\n });\n });\n }\n});\n\nexport default {\n name: PLAY_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n PlayDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/play.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PROGRESS_DIRECTIVE_NAME = 'onProgress';\n\nconst ProgressDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('progress', function(event) {\n var locals = {\n buffered: this.buffered\n };\n\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PROGRESS_DIRECTIVE_NAME],\n $event: event,\n attrs: locals\n });\n });\n }\n});\n\nexport default {\n name: PROGRESS_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n ProgressDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/progress.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 7356ce8862bd1a537b65","webpack:///./src/_module.js","webpack:///./src/eval-service.js","webpack:///./src/ended.js","webpack:///./src/loadedmetadata.js","webpack:///./src/pause.js","webpack:///./src/play.js","webpack:///./src/progress.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AAC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;AAFK,E","file":"media-events.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7356ce8862bd1a537b65\n **/","'use strict';\n\nconst MODULE_NAME = 'media-events';\n\nimport EvalService from './eval-service';\nimport LoadedMetadata from './loadedmetadata';\nimport Progress from './progress';\nimport Ended from './ended';\nimport Play from './play';\nimport Pause from './pause';\n\nangular\n .module(MODULE_NAME, [])\n .service(EvalService.name, EvalService.main)\n .directive(LoadedMetadata.name, LoadedMetadata.main)\n .directive(Progress.name, Progress.main)\n .directive(Ended.name, Ended.main)\n .directive(Play.name, Play.main)\n .directive(Pause.name, Pause.main);\n\nmodule.exports = MODULE_NAME;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/_module.js\n **/","'use strict';\n\nconst EVAL_SERVICE_NAME = 'eval-service';\n\nclass EvalService {\n scopeEval(options = {}) {\n var scope = options.scope;\n var locals = {\n $event: options.$event\n };\n\n if(options.attrs) {\n locals.attrs = options.attrs;\n }\n\n scope.$eval(options.fn, locals);\n }\n}\n\nexport default {\n name: EVAL_SERVICE_NAME,\n main: EvalService\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/eval-service.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst ENDED_DIRECTIVE_NAME = 'onEnded';\n\nconst EndedDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('ended', function(event) {\n evalService.scopeEval({\n scope: scope,\n fn: attrs[ENDED_DIRECTIVE_NAME],\n $event: event\n });\n });\n }\n});\n\nexport default {\n name: ENDED_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n EndedDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ended.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst LOADED_METADATA_DIRECTIVE_NAME = 'onLoadedMetadata';\n\nconst LoadedMetadataDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('loadedmetadata', function(event) {\n var locals = {\n width: this.videoWidth,\n height: this.videoHeight\n };\n\n evalService.scopeEval({\n scope: scope,\n fn: attrs[LOADED_METADATA_DIRECTIVE_NAME],\n $event: event,\n attrs: locals\n });\n });\n }\n});\n\nexport default {\n name: LOADED_METADATA_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n LoadedMetadataDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/loadedmetadata.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PAUSE_DIRECTIVE_NAME = 'onPause';\n\nconst PauseDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('pause', (event) => {\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PAUSE_DIRECTIVE_NAME],\n $event: event\n });\n });\n }\n});\n\nexport default {\n name: PAUSE_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n PauseDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/pause.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PLAY_DIRECTIVE_NAME = 'onPlay';\n\nconst PlayDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('play', (event) => {\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PLAY_DIRECTIVE_NAME],\n $event: event\n });\n });\n }\n});\n\nexport default {\n name: PLAY_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n PlayDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/play.js\n **/","'use strict';\n\nimport EvalService from './eval-service';\n\nconst PROGRESS_DIRECTIVE_NAME = 'onProgress';\n\nconst ProgressDirective = (evalService) => ({\n restrict: 'A',\n scope: true,\n link(scope, element, attrs) {\n element.on('progress', function(event) {\n var locals = {\n buffered: this.buffered\n };\n\n evalService.scopeEval({\n scope: scope,\n fn: attrs[PROGRESS_DIRECTIVE_NAME],\n $event: event,\n attrs: locals\n });\n });\n }\n});\n\nexport default {\n name: PROGRESS_DIRECTIVE_NAME,\n main: [\n EvalService.name,\n ProgressDirective\n ]\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/progress.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 97a277f..c9731a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-media-events", - "version": "1.0.1", + "version": "1.1.0", "description": "angular directives for media events", "main": "./dist/media-events.js", "scripts": {