Viewing 7 replies - 1 through 7 (of 7 total)
  • your page is reloaded each time you clic on the video you try to launch.
    this could be a javascript issue.

    i made a lot of changes on this plugin to make it work for my need (espacialy with the last wordpress version), just ask me and will send you the files

    Thread Starter neubi

    (@neubi)

    it would be great if you could send me the modified files to [email protected]. i’d like to try them and see what happens.

    regards

    just sent you a wetransfer, tell me if all is ok.

    Thread Starter neubi

    (@neubi)

    thanks for the files. now the video that i choose is beeing played. but there is an new strange behaviour: when you are playing a video and then scroll down to choose another one the video beeing played will stop as soon as the player is no longer visible.

    regards
    rainer

    lol yes, sorry this is a feature i added to include multiple galery on a site.

    remove line 87 to 151 in file script.js

    /**
    	 * Temporisation to launch the test not immediatly
    	 */
    
    	var rtime = new Date(1, 1, 2000, 12, 00, 00);
    	var timeout = false;
    	var delta = 200;
    
    	$( window ).scroll( function () {
    		rtime = new Date();
    		if (timeout === false) {
    			timeout = true;
    			setTimeout(scrollend, delta);
    		}
    	});
    
    	function scrollend() {
    		if (new Date() - rtime < delta || YT.Player == null) {
    			setTimeout(scrollend, delta);
    		} else {
    			timeout = false;
    
    			/**
    			 * at scrolling test player visibility and state
    			 */
    
    			for( var key in ytcplayer ) {
    
    				// we check if video is fully visible
    
    				if(inView($('#' + key))){
    
    					// if visible we check if paused or never played
    					// if so, we play it
    
    					if(ytcplayer[key].getPlayerState() == -1 || ytcplayer[key].getPlayerState() == 2) {
    						ytcplayer[key].playVideo();
    					}
    				}
    				else
    				{
    					// if non visible and playing, we pause
    
    					if(ytcplayer[key].getPlayerState() == 1) {
    						ytcplayer[key].pauseVideo();
    					}
    				}
    			}
    		}
    	}
    
    	// check if element is fully visible, return true if so
    	// reusable 
    
    	function inView(element) {
    
    		if( $(element).offset() ) {
    			if( $(element).offset().top > $(window).scrollTop() && $(element).offset().top + $(element).height() < $(window).scrollTop() + (window.innerHeight || document.documentElement.clientHeight)){
    				return true;
    			}
    		}
    		return;
    
    	}
    Thread Starter neubi

    (@neubi)

    wonderful! now everything is fine and work perfect.

    thank you very much for your help

    rainer

    no prob, you re welcome ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Video in the Player is not changing’ is closed to new replies.