There is a problem of React Image loading.
images loading frame by frame.
The Video is below.
https://streamable.com/s/h1xij/mdgbpf
This is a normal behavior of the browser. If you want to show the image once it is downloaded completely then you have to use lazy loading concept.
This library probably helps you https://www.npmjs.com/package/react-lazyload
Demo: https://twobin.github.io/react-lazyload/examples/#/image?_k=vhbmrq
Related
Hey guys I'm new to Aframe and trying to set up a whole bunch of gifs in a spatial web environment.
I'm getting a bit stuck in loading a gif on a plane.
I've loaded the image through the assets folder of Aframe (glitch),
currently it looks like this:
<a-assets>
<img id="dance" src="https://cdn.glitch.com/89b3ce36-3eac-4bb0-865c-585a7fe58409%2Fdance.gif?1556817051483.gif" >
</a-assets>
<a-plane src="#dance" position="5 3 -5" transparent="true" ></a-plane>
Right now the gif shows up, but it is static. How could I get it to start playing?
A-Frame does not support GIFs by default. You need to use a third-party component to render GIFs: https://github.com/mayognaise/aframe-gif-shader
I want to create an online GIF library. I don't have any code yet because I'm only asking if what I want to do is actually possible to achieve:
Only load and play the GIFs that are in the browser's view;
Pause GIFs that are no longer in the browser's view (after scrolling down)
Is this doable?
Please check this figure: 1
It is possible to load only GIFs in viewpoint and load new as you scroll.
It is possible to hide GIFs that are no longer in viewpoint.
You can't really pause images of GIF format. You would have to use some video format like WEBM or MP4, for pausing. For example, Facebook is using video to achieve "pausing gif" effect.
I'm trying to load a local gif for being used on React Native. My main problem is adding it to the Images Assets because Xcode doesn't let me add it to the asset. I've read on GitHub that there's no problem showing an animated gif using React Native but I only have found examples with external images and I need to be loaded locally as it is an important asset for my app.
<Image source={require('image!loading')} />
Thanks for your help.
In Xcode7-beta you can add .gif files - no problem with that. In Xcode6 you indeed can't but I have found that you can simply change extension of the image to .png, add it to assets and wen you use the name (no extension) it will show the gif (including animated gif). It's an interesting workaround :)
I want to create a html5 page with video and an image overlay - meaning some image that is showing over the video. This overlay will in time also be text in some cases. Is there any good way to achieve this?
What I've been trying this far is to use a <video> tag to hold the video, and draw the image into a canvas, which I place on top of the video. To show it I need to move the video back setting z-index to -1, but then the video controls won't work. Maybe there's a solution to make the controls work again, but I'm not sure if I'm on the right path here.. I am assuming there is a recommended solution to this. Maybe using a canvas which I fill both video and overlay into. Or something completely different?
Note: I edited the question as it originally pointed in the wrong direction regarding what was important here. I'd love to have a solution which makes this work seamlessly in fullscreen and everything, but the focus is: What is the appropriate way to place items on top of video - in html5?
Achieving what you want and have it supported in out-of-the-box fullscreen is problematic. Fullscreen support in html5 video is only optional and in any way not accesible thorugh the API (See discussion here).
Even if you used the built in fullscreen there is no way you could inject content above it unless you are willing to change the video file itself on the server in runtime.
what you can do however (And what I did in a similar case) is to implement your own video controls, run the video tag without the built in controls, and have fun with overlaying as many layers as you want on top of your now out of focus video.
As for fullscreen, you can implement some sort of custom background fullscreen similar to what's been done here
edit: The problem you're having by placing a canvas over the video is blocking the built in html video controls. My suggestion is to implement your own video controls (play, pause, volume, seeker, etc.) using html and javascript calling the video API. You can probably even make it prettier then the ugly built in controls.
Your controls can be contained in a layer above the overlaid canvas, and thus the video will be shown, above it the overlay and above it your control set.
You can read a little about implementing your own controls here or here
And anyway this can easily be much better than this.
I have this little problem.
My client wanted two distinct swf on a web page: a viewer on top and a slideshow of images at bottom.
Clicking a link on the slideshow make the viewer load a movie, by means of LocalConnection api.
The slideshow has a default, so when the page is loaded a default movie start.
This works nice on all browser. The only problem I have is on firefox. When screen resolution is too low, or the monitor is too small (netbook) the slideshow remain hidden until scrolling. Therefore at page loading it doesn't start and the main viewer don't get instructed on playing the default video.
As soon as I scroll the page, and the slideshow swf display on page, it starts and everything works fine.
Do you know if there are any solution to this ?
I cannot change the design, I must have two distinct swf, they come from a library he has, and I am trying to reuse components.
thanks
Leonardo
You have to show at least 1px of the swf. AFAIK this is the only way to load swf in FF 3.6+
Is the default always the same? You could have some error handling in the slideshow that would load the default if the connection is not there or the slideshow to load is undefined. It's a guess but it might solve your first run issue.