Giter Club home page Giter Club logo

Comments (8)

ritz078 avatar ritz078 commented on May 25, 2024

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.

enesemini avatar enesemini commented on May 25, 2024

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:

bildschirmfoto 2015-12-27 um 20 26 35

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.

ritz078 avatar ritz078 commented on May 25, 2024

My bad that was an error in the function name. Fixed it. Now it should work fine.

from embed-js.

enesemini avatar enesemini commented on May 25, 2024

You are AMAZING. It's working now.

Thank you very much for your very fast support!!

from embed-js.

 avatar commented on May 25, 2024

Yes ritz078 is amazing! :)

from embed-js.

ritz078 avatar ritz078 commented on May 25, 2024

@enesemini Great.
@comtronix its been long 😄

from embed-js.

 avatar commented on May 25, 2024

What is/was long?

from embed-js.

ritz078 avatar ritz078 commented on May 25, 2024

@comtronix In one word : Thanks 😄 Lets conclude this thread as the issue has been resolved. Cheers.

from embed-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.