diff --git a/README.md b/README.md
index 54b1967..3d2b740 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,26 @@ new ModalVideo('.js-modal-btn');
new ModalVideo('.js-modal-btn', {channel: 'vimeo'});
```
+### MP4
+
+```html
+
+```
+
+```js
+new ModalVideo('.js-modal-btn');
+```
+
+OR
+
+```html
+
+```
+
+```js
+new ModalVideo('.js-modal-btn', {url: 'https://developer.a-blogcms.jp/themes/developer/movies/280.mp4'});
+```
+
## Options
About YouTube options, please refer to https://developers.google.com/youtube/player_parameters?hl=en
@@ -219,6 +239,11 @@ About Vimeo options, please refer to https://developer.vimeo.com/apis/oembed
width |
null |
+
+ custom |
+ url |
+ MP4 URL |
+
xhtml |
false |
diff --git a/js/jquery-modal-video.js b/js/jquery-modal-video.js
index 1b61e76..8d6ae91 100644
--- a/js/jquery-modal-video.js
+++ b/js/jquery-modal-video.js
@@ -10,8 +10,8 @@
*
* custom-event-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
- * author: NO AUTHOR!
- * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com)
+ * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth
+ * homepage: https://github.com/krambuhl/custom-event-polyfill#readme
* version: 0.3.0
*
* es6-object-assign:
@@ -348,6 +348,8 @@ var ModalVideo = function () {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
+ } else if (channel === 'custom') {
+ return opt.url;
}
return '';
}
diff --git a/js/jquery-modal-video.min.js b/js/jquery-modal-video.min.js
index daa0d26..8d9c463 100644
--- a/js/jquery-modal-video.min.js
+++ b/js/jquery-modal-video.min.js
@@ -10,8 +10,8 @@
*
* custom-event-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
- * author: NO AUTHOR!
- * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com)
+ * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth
+ * homepage: https://github.com/krambuhl/custom-event-polyfill#readme
* version: 0.3.0
*
* es6-object-assign:
@@ -22,4 +22,4 @@
*
* This header is generated by licensify (https://github.com/twada/licensify)
*/
-!function(){function e(t,n,o){function i(a,l){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n||e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a\n \n \n "}}]),e}();n.default=u,t.exports=n.default},{"../lib/util":6,"custom-event-polyfill":1,"es6-object-assign":2}],5:[function(e,t,n){"use strict";t.exports=e("./core/")},{"./core/":4}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.append=function(e,t){var n=document.createElement("div");for(n.innerHTML=t;n.children.length>0;)e.appendChild(n.children[0])},n.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()},n.remove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},n.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},n.triggerEvent=function(e,t,n){var o=void 0;window.CustomEvent?o=new CustomEvent(t,{cancelable:!0}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!1,!1,n)),e.dispatchEvent(o)}},{}]},{},[3]);
\ No newline at end of file
+!function(){function e(t,n,o){function i(a,l){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n||e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a\n \n \n "}}]),e}();n.default=u,t.exports=n.default},{"../lib/util":6,"custom-event-polyfill":1,"es6-object-assign":2}],5:[function(e,t,n){"use strict";t.exports=e("./core/")},{"./core/":4}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.append=function(e,t){var n=document.createElement("div");for(n.innerHTML=t;n.children.length>0;)e.appendChild(n.children[0])},n.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()},n.remove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},n.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},n.triggerEvent=function(e,t,n){var o=void 0;window.CustomEvent?o=new CustomEvent(t,{cancelable:!0}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!1,!1,n)),e.dispatchEvent(o)}},{}]},{},[3]);
\ No newline at end of file
diff --git a/js/modal-video.js b/js/modal-video.js
index 633385b..bc5e2f8 100644
--- a/js/modal-video.js
+++ b/js/modal-video.js
@@ -10,8 +10,8 @@
*
* custom-event-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
- * author: NO AUTHOR!
- * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com)
+ * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth
+ * homepage: https://github.com/krambuhl/custom-event-polyfill#readme
* version: 0.3.0
*
* es6-object-assign:
@@ -323,6 +323,8 @@ var ModalVideo = function () {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
+ } else if (channel === 'custom') {
+ return opt.url;
}
return '';
}
diff --git a/js/modal-video.min.js b/js/modal-video.min.js
index 041442f..90fd1a7 100644
--- a/js/modal-video.min.js
+++ b/js/modal-video.min.js
@@ -10,8 +10,8 @@
*
* custom-event-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
- * author: NO AUTHOR!
- * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com)
+ * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth
+ * homepage: https://github.com/krambuhl/custom-event-polyfill#readme
* version: 0.3.0
*
* es6-object-assign:
@@ -22,4 +22,4 @@
*
* This header is generated by licensify (https://github.com/twada/licensify)
*/
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.ModalVideo=e()}}(function(){return function(){function e(t,n,o){function i(a,l){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n||e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a\n \n \n "}}]),e}();n.default=u,t.exports=n.default},{"../lib/util":5,"custom-event-polyfill":1,"es6-object-assign":2}],4:[function(e,t,n){"use strict";t.exports=e("./core/")},{"./core/":3}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.append=function(e,t){var n=document.createElement("div");for(n.innerHTML=t;n.children.length>0;)e.appendChild(n.children[0])},n.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()},n.remove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},n.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},n.triggerEvent=function(e,t,n){var o=void 0;window.CustomEvent?o=new CustomEvent(t,{cancelable:!0}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!1,!1,n)),e.dispatchEvent(o)}},{}]},{},[4])(4)});
\ No newline at end of file
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.ModalVideo=e()}}(function(){return function(){function e(t,n,o){function i(l,a){if(!n[l]){if(!t[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(r)return r(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[l]={exports:{}};t[l][0].call(s.exports,function(e){var n=t[l][1][e];return i(n||e)},s,s.exports,e,t,n,o)}return n[l].exports}for(var r="function"==typeof require&&require,l=0;l\n \n \n "}}]),e}();n.default=u,t.exports=n.default},{"../lib/util":5,"custom-event-polyfill":1,"es6-object-assign":2}],4:[function(e,t,n){"use strict";t.exports=e("./core/")},{"./core/":3}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.append=function(e,t){var n=document.createElement("div");for(n.innerHTML=t;n.children.length>0;)e.appendChild(n.children[0])},n.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()},n.remove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},n.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},n.triggerEvent=function(e,t,n){var o=void 0;window.CustomEvent?o=new CustomEvent(t,{cancelable:!0}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!1,!1,n)),e.dispatchEvent(o)}},{}]},{},[4])(4)});
\ No newline at end of file
diff --git a/lib/core/index.js b/lib/core/index.js
index 177628e..9c25601 100644
--- a/lib/core/index.js
+++ b/lib/core/index.js
@@ -204,6 +204,8 @@ var ModalVideo = function () {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
+ } else if (channel === 'custom') {
+ return opt.url;
}
return '';
}
diff --git a/src/core/index.js b/src/core/index.js
index 83a20b8..2c96ec0 100644
--- a/src/core/index.js
+++ b/src/core/index.js
@@ -191,6 +191,8 @@ export default class ModalVideo {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
+ } else if (channel === 'custom') {
+ return opt.url;
}
return '';
}
diff --git a/test/index.html b/test/index.html
index 33ad13a..a06ea28 100644
--- a/test/index.html
+++ b/test/index.html
@@ -11,7 +11,7 @@
- video
+ video