What is rel=”alternate” hreflang=”x”?

Hreflang is used to determine language of the content on the page, it helps search engine (like: Google) to identify language on the page so they can serve it to right reader base. <link rel="alternate" href="http://ashishuideveloper.in” hreflang="en" /> OR <link rel="alternate" href="http://ashishuideveloper.in” hreflang="en-in” /> hreflang is introduced by Google in December 2011. It is useful when site has more then one languages. Adding it specifies to search engine this site has localise content for specific region or language, so search

Continue Reading

Show Poster Image directly from Video

Poster Image

Poster image is first instance on video to impress & engage user to play video. By keeping poster image clear & from video will make user interested to click on play button. In continuation to my earlier post for Video, I further dig-out on video element. While working on video element we also have to show a still image on video as a placeholder image. Until user click on the video to play it we need to show user a still from video.

Continue Reading

Difference Between Promises & Callbacks

Promises are not Callbacks. A Promise is a value which may be available in future or not. A Callback is a function which we call inside other function. Normally callback runs after the parent function completes its operation. Let’s say the function is sending AJAX query, we can use callback function in a way so, when the AJAX request gets response, we can use the response in the function to do some other operation. In case you are interested to

Continue Reading

Accessible HTML5 Video Player w/ Closed Caption (CC)

HTML 5 Video w/Closed Caption Thumbnail

To have HTML5 Video on page is good and to have it with Closed Caption is even better, as it will make video accessible for physically challenged as well. This post is in continuation of my earlier post on HTML5 Video. In this post I have covered one of the most important feature of videos, Closed Caption. I received a comment in my earlier post to include the closed caption feature in the script to make it more helpful. Please refer

Continue Reading

Introduction to Javascript Promises API

Javascript Promises API

A Promise is a value not necessarily known at the time of it’s creation. It mainly used in asynchronous actions resulting in success or failure. The Promises represents a value which may be available now, or in the future, or never. Promises new Promise(function(resolve, reject) { }).then(function() { }).catch(function() { }); then() and catch() are prototype methods and they can ben chained as shown above. A Promise will always be either “Pending” or “Fulfilled” or “Rejected”. Pending – Initial state, operation not

Continue Reading