Skip to content

Scope and Video mode not working together #30

@Corchoneitor

Description

@Corchoneitor

Tried to use both features in the same instance and didn't work.
I did some digging and solved it. It also works if there are gifs and video in the same scope.
I'm not doing a pull request because I didn't tested so well, but here is the code if you want to do it. I apologyze if this is not the right way.

processScope: function(){
	var scope = this.getOption('scope');
	if( scope ){
		if(GifPlayer.scopes[scope]){
			if ( GifPlayer.scopes[scope].mode == 'gif' ) {
				GifPlayer.scopes[scope].stopGif();
			} else if ( GifPlayer.scopes[scope].mode == 'video' ) {
				GifPlayer.scopes[scope].pauseVideo();
			}
		}
		GifPlayer.scopes[scope] = this;
	}
}
this.videoElement.on('click', function(){
	if(gp.videoPaused){
		gp.processScope();
		gp.resumeVideo();
	}else{
		gp.pauseVideo();
	}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions