Coder Social home page Coder Social logo

Comments (8)

krnlde avatar krnlde commented on June 11, 2024

You can see an example how its done at http://proloser.github.com/AnythingSlider/video.html

from basic-jquery-slider.

DeFeNdog avatar DeFeNdog commented on June 11, 2024

Not a great fix, but I targeted the embed element.

// Custom video click event
    if (settings.clickPause && settings.automatic) {
        $("embed").click(function () {
            if (!paused) {
                clearInterval(bjqsInterval);
                paused = true;
            }
        });
    }

from basic-jquery-slider.

DeFeNdog avatar DeFeNdog commented on June 11, 2024

Oops.. that only works outside of the slider. My mistake!

from basic-jquery-slider.

marcb12 avatar marcb12 commented on June 11, 2024

Hmm serious, even on the basic-slider.com website you are promoting with the fact that video is supported but when you play the video the slideshow just keeps on running... A huge bug I would say...

Anyone any idea?

from basic-jquery-slider.

DeFeNdog avatar DeFeNdog commented on June 11, 2024

Here's what I had to do for my video to finally work. It's a bit tedious and maybe unnecessary. I'm hoping someone comes up with a much more elegant way of doing this. Sorry for my hideous "solution".

  1. Built custom player with YouTube API. It seemed like the only way I could programmatically target an element within the player (http://demo.tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/youtube-player.html)

  2. Changed a few things in basic-jquery-slider.js

// Added at approx line 238:

    // Pause on play
    $("#player").click(function () {
        if (!paused) {
            clearInterval(bjqsInterval);
            paused = true;
            vblurred = true;
        }
    });

// Modified at approx line 220:
    // Run a bubble-bath and float in that m'fkr like a hovercraft. (enable hover pause)
    if (settings.hoverPause && settings.automatic) {

        $container.hover(function () {
            if (!paused) {
                clearInterval(bjqsInterval);
                paused = true;
            }
        }, function () {
  if ( vblurred == false) {
                if (paused) {
                    bjqsInterval = setInterval(function () {
                        bjqsGo(forward)
                    }, settings.rotationSpeed);
                    paused = false;
                }
            } 
        });

    }

// Added the following variable to some functions, so as to reset the pause state (approx lines 99, 107, 194):

    vblurred = false;

from basic-jquery-slider.

marcb12 avatar marcb12 commented on June 11, 2024

Thanks for the reply but I'm sorry to have to say that I switched to a different slider. Rhinoslider (http://rhinoslider.com/) in combination with tubeplayer (for easy styling of the youtube player) turned out to be a pretty good out-of-the-box solution.

Hope this issue will be resolved with the basic-jquery-slider though, love the 'basic' approach!

from basic-jquery-slider.

DeFeNdog avatar DeFeNdog commented on June 11, 2024

Very cool slider! Thanks marcb12

from basic-jquery-slider.

jcobb avatar jcobb commented on June 11, 2024

Hey marc, sorry to hear you've switched to a different slider, but glad you found out to suit your needs.

DeFeNdog is spot on with his solution - the only way to programmatically stop the slider is by using the javascript APIs of the respective video services to embed videos.

Apologies for any inconvenience you had.

from basic-jquery-slider.

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.