Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Janky when looping through sprites #11

Open
JimmyRittenborg opened this issue Dec 7, 2015 · 4 comments
Open

Janky when looping through sprites #11

JimmyRittenborg opened this issue Dec 7, 2015 · 4 comments

Comments

@JimmyRittenborg
Copy link

There seems to be a jank between each sprite when doing this

var canvidControl = canvid({
    selector : '.video',
    videos: {
        clip1: { src: 'clip-1.min.jpg', frames: 32, cols: 6, fps: 30, loops: 1, onEnd: function(){
          canvidControl.play('clip2');
        }},
        clip2: { src: 'clip-2.min.jpg', frames: 32, cols: 6, fps: 30, loops: 1, onEnd: function(){
          canvidControl.play('clip3');
        }},
        clip3: { src: 'clip-3.min.jpg', frames: 32, cols: 6, fps: 30, loops: 1},
    },
    width: 640,
    height: 360,
    loaded: function() {
        canvidControl.play('clip1');
    }
});
@moklick
Copy link
Collaborator

moklick commented Dec 7, 2015

Thanks! I will check that

@gka
Copy link
Owner

gka commented Dec 7, 2015

Maybe it makes sense to allow playing of a sequence of multiple clips using one play() call:

canvidControl.play(['clip1', 'clip2', 'clip3']);

Seems to be a common use case. This would probably make it easier to solve the jank issue internally.

@rumbogs
Copy link

rumbogs commented Feb 29, 2016

I don't think it can be solved, I've tried to implement a different playback system starting from canvid js, and it seems to be an issue with the implementation of requestAnimationFrame that skips a frame when switching sprite sheets.

@gka
Copy link
Owner

gka commented May 10, 2016

can you provide a complete test for this issue, for instance on jsbin / jsfiddle or similar? I tried to reproduce it with a multi-clip video but didn't see janks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants