Comments (8)
Hi @enesemini ,
Just added it on es6 branch.
Here are steps:
In options pass:
videoClickClass : 'ejs-video-thumb', // custom class name
customVideoClickHandler : true,
videoClickHandler : function (options, template) {
// write your function here. This will be executed when someone click the passed className
// template(url, options) returns the final (only video) template string.
}
I hope this solves both your issues. Let me know if this works fine so that i can merge this to master.
from embed-js.
Hey @ritz078,
Thank you for your quick reply. I'm having a little trouble getting it to work.
I replaced the old embed.min.js with the new one from the es6 branch, and I added the new options, but I'm getting the following error in the browser console:
I'm applying the following options:
ejs.setOptions({
videoClickClass: 'video-play', // custom class name
customVideoClickHandler: true,
videoClickHandler: function(className, options) {
// write your function here. This will be executed when someone click the passed className
// template(url, options) returns the final (only video) template string.
var _this = this;
var classes = document.getElementsByClassName(className);
var _loop = function _loop(i) {
classes[i].onclick = function () {
options.onVideoShow();
var url = classes[i].getAttribute('data-ejs-url') + "?autoplay=true";
classes[i].parentNode.parentNode.innerHTML = _this.template(url, options);
};
};
for (var i = 0; i < classes.length; i++) {
_loop(i);
}
}
});
from embed-js.
My bad that was an error in the function name. Fixed it. Now it should work fine.
from embed-js.
You are AMAZING. It's working now.
Thank you very much for your very fast support!!
from embed-js.
Yes ritz078 is amazing! :)
from embed-js.
@enesemini Great.
@comtronix its been long 😄
from embed-js.
What is/was long?
from embed-js.
@comtronix In one word : Thanks 😄 Lets conclude this thread as the issue has been resolved. Cheers.
from embed-js.
Related Issues (20)
- error when code language not specified.
- umd build throws error for youtube
- Add caching support HOT 3
- Remove play from all description
- replaceText option doesn't work HOT 1
- Fail compiling with Webpack (production env) HOT 4
- Import Error Gulp/Webpack Task HOT 3
- expected object, got undefined HOT 7
- Link containing '@' is not rendered correctly HOT 2
- The examples seem to be broken HOT 1
- demo fails HOT 1
- 404 link on website HOT 2
- Question: Any rich commenting components this? HOT 1
- Embedjs not working HOT 1
- Does not work on plain JS/jQuery HOT 1
- YouTube plugin not correctly parsing full urls HOT 1
- The codesandbox example in the readme doesn't work with youtube HOT 1
- Unsecure dependency HOT 2
- Looking for maintainers HOT 4
- Unable to use Emoji plugin via CDN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embed-js.