-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizing Video Templates #79
Comments
Hi @enesemini , Here are steps: 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. |
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);
}
}
}); |
My bad that was an error in the function name. Fixed it. Now it should work fine. |
You are AMAZING. It's working now. Thank you very much for your very fast support!! |
Yes ritz078 is amazing! :) |
@enesemini Great. |
What is/was long? |
@comtronix In one word : Thanks 😄 Lets conclude this thread as the issue has been resolved. Cheers. |
Hello Ritesh,
I'm at the process of making a custom template for the different video embeds for my application.
While changing the template it self turned out to be pretty easy (example below with youtube):
Now I am struggling to get the right functionality with clicking the video thumbnail and letting it play.
The code responsible for this should be these two parts:
(embed.js around line 300)
And at line 3304 the function is called. But in order for it to work I would have to use the 'ejs-video-thumb' class:
So here are my questions:
Once again, thank you for your effort.
Kind regards,
Enes Emini
The text was updated successfully, but these errors were encountered: