gka / canvid Goto Github PK
View Code? Open in Web Editor NEWtiny js library for playing video on canvas elements (without audio)
Home Page: https://gka.github.io/canvid
License: ISC License
tiny js library for playing video on canvas elements (without audio)
Home Page: https://gka.github.io/canvid
License: ISC License
我翻译了一下它的一些用法,可能不是很准确。
有误的地方,见谅。http://www.xttblog.com/?p=1814
I've tried it on a Android 4.3 device with Chrome 46, and the canvas ends up larger than the frame. I don't see a video, but rather, a scrolling fly by over the sprite sheet.
Hi,
I'm having some issues loading my video.jpg file into my react component. I've tried in all react life cycle handlers but it doesn't seem to work?
Got any clue what I should do?
If you'd add a method / property which returns current frame / time, it can be extended to sync with audio in the background.
Android 5.x version jpg frame animation picture will appear jump frame, png will not, advanced version of Android will not appear to jump frame, how to solve?
Just a quick tip you maybe could include in your docs.
For a great ~85% reduction in filesize install jpeg-recompress
On a mac simply brew install jpeg-archive
and than jpeg-recompress --quality high clip1.jpg clip1.min.jpg
Is there a way to make infinite loop ? Configuring loop to -1, doesn't seem to work.
Facing issue on Android. When there is more than one canvid playing on the page, the sprite > 400 KB makes other sprites frame load slower.
Example: have 2 canvids less than 400kb loading fine on page. When I add the third one with size > 400KB. All three players become very slow. Kind of loading 1 frame per sec.
While if the sprite > 400KB is played alone on page, it works fine... But with other sprites it is causing issue.
I am aware there is a known issue on devices for bigger sprites.. But the one I am referring to is just 400 KB and has 102 frames. And there is no issue when the sprite is the only sprite loaded on page.
In order to make clip2 play, clip1 has to have loop: 1
and a
onEnd: function(){
canvidControl.play('clip2');
}
So clip2 actually never starts.
I could be wrong but there doesn't seem to be a way to do this right now. As a workaround, in my own CSS, I added the .canvid class and added the extra styling that I wanted, but I'd prefer to be able to pass through the canvid creation function instead.
Hi there :)
I see you on http://tympanus.net/codrops/collective/collective-180/,
Your lib seems nice, a small example of it's usage will be cool, on CodePen or similar websites,
What do you think ?
canvid?
canv ~ I ~ D?
can ~ vi ~ D?
The image playback has an issue with the origin position.
Tested in Chrome version 48 on Android 6.0. Maybe a Chrome issue.
it can run pc and ios ,but in android ,it can't run.
why ?
It would be awesome to have a destroy method.
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');
}
});
Hi, thanks for canvid, it's a great idea. I have very little experience of canvas and I was wondering if it was possible to integrate a canvid video within the wider "context" (in the ordinary sense) of a canvas element, so the canvas could contain other stuff along with the canvid(s).
The video clips like:
{
clip00: {src: 'static/video/00.jpg', frames: 24, cols: 6, fps: 12},
clip01: {src: 'static/video/01.jpg', frames: 24, cols: 6, fps: 12},
clip02: {src: 'static/video/02.jpg', frames: 24, cols: 6, fps: 12},
clip04: {src: 'static/video/04.jpg', frames: 24, cols: 6, fps: 12},
clip05: {src: 'static/video/05.jpg', frames: 24, cols: 6, fps: 12},
}
I visit the website and the canvid will switch the clip to a specific one in some condition. Is there a way for saving the transferred network data if some clips have no necessary being played?
Or I have to get the condition first then create the canvid dynamically?
Hello, I'm unsure of how to ask this in a non-awkward way, but would it make sense to suggest iphone-inline-video in the readme as an alternative solution that overcomes the two limitations of canvid? (i.e. short+soundless)
So I can do this:
var canvidControl = canvid({
selector : document.querySelector(".myelement"),
videos: {
clip1: { src: 'clip1.jpg', frames: 38, cols: 6 },
clip2: { src: 'clip2.jpg', frames: 43, cols: 6, loops: 3 }
},
width: 500,
height: 400,
loaded: function() {
canvidControl.play('clip1');
// reverse playback
// canvidControl.play('clip1', true);
}
});
I have multiple videos on page and all of them have same selectors.
Hey,
thanks for this library. Just playing around because I'm searching right now for a solution for an animation of mine. Have you ever tried to control the video through scrolling? I'm thinking of a like parallax effect. The video "plays" while scrolling. Back or forward. Do you think this is possible?
Greets
canvidControl.pause() is not a function in React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.