madeyourday / contao-rocksolid-slider

RockSolid Slider Contao Extension
http://rocksolidthemes.com/de/contao/plugins/responsive-slider
Other
9 stars 7 forks source link

Slider with Mediaelement #52

Closed vmulot closed 6 years ago

vmulot commented 6 years ago

Hi, i did a content slider, with 2 slides 1 - image and text 2 - video (contao video CE) and text

i included the js_mediaelement so the player looks nice but it' doesn't "find" my video element. (it works on some other vids in the same page). any advice ? thanks!

ausi commented 6 years ago

I was not able to reproduce this issue. Can you provide a link to the affected page?

vmulot commented 6 years ago

is there a way i can send you as private ? the ebsite is still in dev

ausi commented 6 years ago

You can create a private ticket at https://my.rocksolidthemes.com/support or send an email to support@rocksolidthemes.com

ausi commented 6 years ago

The slider uses the slide effect side-slide which removes all slides, except the visible one, from the DOM. This is why the MediaElement script cannot find the video.

You have to initialize the player when the slide gets injected back into the DOM. This is possible with the following JavaScript code for example:

jQuery('.mod_rocksolid_slider').on('rsts-slidestart', function(event) {
    event.rstSlider.slides[event.rstSlider.slideIndex]
        .element.find(':not(picture) > video, :not(picture) > audio')
        .mediaelementplayer({
            pluginPath: '/assets/mediaelement/plugins/'
        });
});