Fully responsive HTML5 video

Use width and max-height on the <video> element:  Run code snippetExpand snippet http://jsfiddle.net/fHG69/ Also, you’re missing a semicolon after background-color. When absolutely positioning an element to fill the screen, I prefer to set top, bottom, left, and right instead of setting height and width.

What is the non-jQuery equivalent of ‘$(document).ready()’?

This works perfectly, from ECMA. The snippet is all you need, but if you want to dig more and explore other options check this detailed explanation. The window.onload doesn’t equal to JQuery $(document).ready because $(document).ready waits only to the DOM tree while window.onload check all elements including external assets and images. EDIT: Added IE8 and older equivalent, thanks to Jan Derk‘s observation. You may read … Read more

What are differences between SystemJS and Webpack?

If you go to the SystemJS Github page, you will see the description of the tool: Universal dynamic module loader – loads ES6 modules, AMD, CommonJS and global scripts in the browser and NodeJS. Because you use modules in TypeScript or ES6, you need a module loader. In the case of SystemJS, the systemjs.config.js allows us to … Read more

JavaScript: function returning an object

In JavaScript, most functions are both callable and instantiable: they have both a [[Call]] and [[Construct]] internal methods. As callable objects, you can use parentheses to call them, optionally passing some arguments. As a result of the call, the function can return a value. The code above calls function makeGamePlayer and stores the returned value in the variable player. In this case, you may want … Read more