tjenkinson / clappr-thumbnails-plugin

A plugin for clappr which will display thumbnails when hovering over the scrub bar. Thumbnails can either be individual images or a sprite sheet.
https://tjenkinson.github.io/clappr-thumbnails-plugin/demo/
MIT License
44 stars 14 forks source link

Add plugin into the plugins array without adding it into "core" #129

Closed anesuc closed 2 years ago

anesuc commented 2 years ago

Hi all,

I've got several other plugins that do not use core except this one. Is there a way I can use this plugin without adding it into plugins.core?

tjenkinson commented 2 years ago

Hi. Is there a reason you can’t add it to core? I haven’t looked at this in a while but I think it’s using core events.

anesuc commented 2 years ago

Yes that's because all my other plugins don't use core. They expect plugins to be an array with them in it instead of an object that has a core array in it. They don't work in core. If there is a way to do both that would be good.

tjenkinson commented 2 years ago

Sorry still not following. It should be possible for clappr to take a mix of different plugins?

anesuc commented 2 years ago

Now it might be that this plugin does not work with dash shaka .mpd source playback? I am trying to find a basic plugin I can test in the demo html that is designed for generic video playback.

With that said my theory was that, the plugins variable is either an array or an object depending on whether I have core. it's either:

setup = { plugins:[somePlugin] }

OR

setup = { plugins:{ core:[somePlugin] } }

I did try setting core variable inside an array of plugins that didn't work. But again, it could just be that I can't use this plugin on this type of media?

tjenkinson commented 2 years ago

I think it should work fine but you’ll need to add the other plugins to the other property based on their type, probably container

see https://github.com/clappr/clappr-core#plugins

anesuc commented 2 years ago

I resolved my issue. I do realise I came reporting this assuming it was to do with where he plugin is defined that resulted it in not working. However the problem was a version issue.

It turns out I was using https://cdn.jsdelivr.net/clappr.thumbnails-plugin/latest/clappr-thumbnails-plugin.js but instead https://cdn.jsdelivr.net/npm/clappr-thumbnails-plugin@3 worked for me. Might be something to do with the clappr version I have but yeah