How do websites have various animated elements? - javascript

I'd like to learn how to build animated areas on websites, like Aeria Games does on their website.
http://www.aeriagames.com/
When the page loads the top banner begins to animate, and then each banner rotation after that is also animated.
Does anyone know of a guide/tutorial to accomplish the same result?

You can use video (for .ogg, .webm, .mp4) embed (for .swf) or img (for .gif)
ex:
<video width="320" height="240">
<source src="movie.mp4" type="video/mp4">
</video>
or
<embed src="helloworld.swf">
or
<img src="animation.gif" alt="Animation" height="42" width="42">

Related

How to add video in parallax Slider?

I have a parrallax slider, I have put just image and description on slider, and I want to add a video, this is my code:
{ <div id="da-slider" class="da-slider">
<div class="da-slide">
<h2>Vidéo PUB</h2>
<p>loading</p> <!--wanna put the video here -->
</div>
<div class="da-slide">
<h2>Affréteurs</h2>
<p></p>
<div class="da-img"><img src="" alt="" /></div>
</div> }
My problem is the video is static.
I'm currently using this slider:
Yii2 Da-Slider
I want to:
Add it to the first slide
Set it so it autoplays
After the video finishes playing I want the slider to automatically resume and move to the next slide.
How can I do this?
I would recommend setting up a YouTube account to host your video on.
If the site is popular then it offloads the strain of serving the video file over to YouTube's fast, dedicated servers.
Once you have got your YouTube video uploaded you can add it to the slide by clicking the Share button beneath the video and then clicking Embed. This will give you a snippet of code like this which you can use in your slider code above:
<iframe width="560" height="315" src="https://www.youtube.com/embed/_dJCLaoBZvM?rel=0" frameborder="0" allowfullscreen></iframe>
Notice the rel=0 on the end. That stops it suggesting other videos once yours has finished playing which makes the whole thing more professional. You can also add autoplay=1 if you want it to start playing straight away. There are also more advanced integrations that you can do where you control the chrome of the video player (the skin around the edge).
I've done this before with parallax and it comes out looking amazing.
I prefer this method to a service like Youtube or Vimeo because you have more control and be able to style it how you want more effectively.
You want to get your video in mp4 and ogg format. You can do this with VLC media player. It's free.
Then I used the html5 <video> tag (Link Here). here is a sample. You will want to style for position, etc... in your CSS.
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

How to use videojs with a jekyll powered site

Trying to create a custom skinned video player on this page.
http://turbosaurusrex.github.io/keets/
I'd like to hide every element except the play button. I've linked video.js and the css file but it doesn't seem like it's working?
I threw the cdn right after the body tag:
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/c/video.js"></script>
The video player returns the browser's native player. No change I make to the css does anything. Is this a jekyll thing I've overlooked, am I stupid or what? I don't know. P
You need an id attribute and data-setup for each video.
https://github.com/videojs/video.js/blob/stable/docs/guides/setup.md#step-2-add-an-html5-video-tag-to-your-page
<video autoplay="" controls="" loop="" poster="/video/keets/keet1.jpg" id="firstvid" class="video-js vjs-default-skin col-xs-12" data-setup="{}">
<source src="/video/keets/keet1.webm" type="video/webm">
<source src="/video/keets/keet1.mp4" type="video/mp4">
</video>

Displaying a video onLoad

What I would like is to have a video play in full screen once and then disappear leaving the web page behind. is this possible using Javascript, HTML and possibly CSS?
The video in question is called Website Opening.mp4
<video width="100%" autoplay="autoplay">
<source src="movie.mp4" type="video/mp4" />
</video>
Edit: When autoplay attribute is present, the video will automatically start playing as soon as it can i.e. when the page loads.

wrapping html 5 video tag around embedded video player

I'm looking for a way so a certain embed link from youtube/video/other video provider that doesn't have an API can be wrapped around a HTML5 <video> tag. And if I'm then able to use the HTML5 features of this tag? I'm looking for something like this:
<video width="560" height="315" controls autoplay>
<iframe width="560" height="315" src="http://www.youtube.com/embed/5qm8PH4xAss" frameborder="0" allowfullscreen></iframe>
</video>
or this:
<video width="640" height="505" controls autoplay>
<object width="640" height="505" type="application/x-shockwave-flash" data="http://www.youtube.com/v/YE7VzlLtp-4">
<param name="movie" value="http://www.youtube.com/v/YE7VzlLtp-4" />
</object>
</video>
I'm actually looking to generalise the video providers embedded video options, I would like to be able to call play(), stop(), ... from javascript without limiting to only video providers that have specified an API. I'm basicly looking for something like this: http://www.w3.org/2010/05/video/mediaevents.html
What you're asking for is not possible unless what you're describing is a direct link to a video file, and even then that's probably not enough, and I'll explain why:
Firstly, the HTML5 <video> element is designed to work with videos, not Flash objects. Secondly, different browsers only support certain video formats:
FireFox: OGV, WebM
Internet Explorer: MP4
Safari/iOS: MP4
Chrome: MP4, WebM
So unless you have video sources to an MP4 version of the video AND an OGG version of the video, it won't work in all modern browsers. E.g.:
<video width="640" height="360" controls>
<source src="__VIDEO__.MP4" type="video/mp4" /><!-- Safari / iOS video -->
<source src="__VIDEO__.OGV" type="video/ogg" /><!-- Firefox / Opera / Chrome10 -->
<!-- Fallback code (e.g. Images, Flash, text, etc.) -->
</video>

Browsing and playing videos in HTML5

To watch videos in an HTML5 web player requires us to add the source of the video in the HTML code like this:
<video id="example" class="video" controls preload="none" width="500" height="300"
poster="abc.jpg" data-setup="{}">
<source src="../87D645D1d01.ogv" type='video/ogg' />
</video>
So is there any way with which we can browse a media file in our local file system irrespective of the OS and then add the pah to the SRC: part of video element like we do it in any desktop based video players and then play it?
Regards.
Anuj.

Categories

Resources