Showing posts with label Programming. Show all posts

Advantages & Disadvantages of Using HTML5 for e-Learning Development

With increasing the use of mobile devices by learners, the demand of HTML5 is gone up as it becomes the forefront of eLearning development. We all know that HTML5 is the current version of Hypertext Markup Language by which eLearning professionals and experts are able to publish and deliver the content to the learner's iPad, iPhones and other smart-phones.

eLearning with HTML5

Using this high-end language for eLearning development, users can get many benefits and make their work a lot easier as well as simpler than before. Here are some major advantages of HTML5 for eLearning development:


Extremely Helpful in Embedding Audio & Video:

Since the inception of HTML5, the embed of audio, video and other multimedia content becomes a lot easier as HTML5 embedding all these in the browser without relying on third-party plugins. Users of this high-end language do not have to download any software in order to view the multimedia content in e-Learning courses.


Highly Flexible & Easy to Access:

The best thing about HTML5-based courses is that they are highly flexible and easy to access. Users are able to maintain the content in a single source and provide to their audience, new visitors and precious clients as they just need to publish courses to HTML5. This way, the gyrating time will be decreased that makes large-scale implementation easily possible.


Extremely Interactive:

We all know that multimedia content like audio, video and some other important stuff play a very significant role in making any online course much interesting and engaging. So, HTML5 makes it easily possible for eLearning developers as they can develop games and other interactivities, which are mobile-friendly. There are lots of animations that are possible with HTML5.


Gives A Drag and Drop API:

HTML5 Gives A Drag and Drop API

Users of HTML5 can get a Drag and Drop API (Application Programming Interface), which is mainly used in eLearning development. You can find various eLearning developers, who are using Drag and Drop interactivity as an appraisal interactivity. It also facilitates better comprehension of the learning content.


Mobility:

One of the major benefits of HTML5 is to provide the content to mobile devices like smart-phones, iPads as it makes it very exciting plan for eLearning developers. It carries some highly exciting features like well supported by mobile browsers and more. Because of this major advantage lots of learners can take the eLearning courses anytime and anywhere on their mobile devices when they get time.


These are the top and main benefits of HTML5 for eLearning development, so eLearning developers can use this high-end language and get the benefits. Apart from these benefits, there are some disadvantages of HTML5 for eLearning development that you can find below:


Lack of Cross-Browser Compatibility:

HTML5’s developed applications are not always supporting on all the browsers, so it is one of the major drawback of HTML5. However, if you developed applications with Flash as plug-in are compatible with all the browsers and do not have any kind of compatibility issues.


Not Have Support to Legacy Browsers:

We all know that HTML5’s main commitment was to support and has compatibility with old browsers, but it is not completely supportive with the major browsers. It is also talented to only some extent like the legacy versions of the IE (Internet Explorers) are not supporting with HTML5. So, because of this issue, you can find lots of developers, who choose to go for HTML4; but HTML5 is compatible with some new and major browsers.


Restriction of Graphics and Animations:

With the help of Adobe Flash, we are able to develop rich graphics and animations, but when it comes to use HTML 5 as option, you are restricted up to some limit as it does not provide that much of flexibility as Flash. Therefore, you can find lots of developers, who are still opting for JavaScript and CSS to develop graphics and animation.

These were some of the of disadvantages of using HTML5 for developing eLearning courses, so every developer needs to understand before he starts using it for the development.

Keep visiting our blog for more information on HTML5 and its solutions as we are regularly update some useful and major information that you should know.


Comparison Chart of 35+ Awesome Websites to Learn Coding Online

We all know that learn coding is not child’s play as it needs some special expertise and skills that make us capable code intelligently. There are lots of people worldwide, who are looking for learning the best programming languages in order to get started with application development and some other wonderful tasks.

Online code learning websites comparison chart

It doesn’t matter what your age or experience is, you can find plethora of tools and technologies that help you to get started and refine your programming chops. To make learning code easier, here I have listed a comparison chart that can help you to choose the best code teaching website as per your need.

Have a look the comparison chart to get a bird’s eye view of all these awesome places to learn how to code.

Choose The Best Fitted You
No Name/Website Courses Features Pricing Difficulty
1 Codecademy HTML, CSS, JavaScript, jQuery, PHP, Ruby, Python, API Code Interpreter, Progress Saver, Project, Forum Free Easy – Intermediate
2 Develop PHP HTML, CSS, JavaScript, PHP and MySQL Videos, Tutorials Free Easy – Hard
3 Code Avengers HTML5, CSS3, JavaScript Code Interpreter, Progress Saver, Project, Note Free Easy
4 The Code Player HTML5, CSS3, Javascript Videos, Source Code, Code Interpreter Free Intermediate – Hard
5 Code HTML, CSS, CSS3, JavaScript, jQuery, Ruby, Code Interpreter, Progress Saver, Discussion Free Easy – Intermediate
6 Code School HTML5, CSS, CSS3, jQuery, Ruby, Ruby on Rails, iOS Code Interpreter, Screencast, Progress Saver, Forum Free, $25/month Intermediate – Hard
7 Codepen jQuery, CSS, HTML Code Interpreter, Discussion Free Easy – Hard
8 Khan Academy Programming Basics, Canvas Drawing, Animation, User Interaction Code Interpreter, Screencast, Progress Saver, Project, Discussion Free Easy – Intermediate
9 Programmr Android, iOS, jQuery, J2EE, Flash, PhoneGap Project, Contest Participation Free, Signup Need Intermediate – Nightmare
10 Treehouse HTML, CSS, CSS3, JavaScript, jQuery, Ruby, Ruby on Rails, iOS, Android, UX, Database Code Interpreter, Screencast, Progress Saver, Project, Forum Free, $25/month, $49/month Easy – Hard
11 Talent Buddy C, C#, C++, Javascript, PHP, Python, Ruby Code Interpreter, Mobile App Free, Signup Need Intermediate – Hard
12 LearnStreet HTML, CSS, JavaScript, Python, Ruby Code Interpreter, Progress Saver, Project, Forum Free Easy
13 Udacity Web Development, HTML5, Python, Java, Computer Science, Algorithm, AI Code Interpreter, Screencast, Progress Saver, Forum Free Intermediate – Nightmare
14 CodeHS Problem Solving, JavaScript, Animation, Game Programming Code Interpreter, Screencast, Progress Saver Free, $25/month, $75/month Easy – Intermediate
15 Scratch Visual Programming Visual Editor, Project, Forum Free Easy
16 HTML5 Rocks HTML5 Blogs Online, Tutorials Free Hard
17 SQLZOO SQL Code Interpreter Free Easy – Hard
18 Mozila Developer Network HTML, CSS, Javascript Tutorials, Demos, Discussion Free Easy – Hard
19 Learneroo Java, Loops, Strings and Array Tutorials, Discussion Free Easy
20 Koding Hack Ruby, Go, Java, NodeJS, PHP, C, Python, etc. Code Interpreter, Discussion $19 to $99/Month Intermediate – Nightmare
21 Plural Sight Ruby, HTML5, iOS, Javascript Code Interpreter, Videos Free, Signup Need Easy – Hard
22 The New Boston Ajax, C++, Java, PHP, Python, Ruby Videos Free Easy – Hard
23 Udemy HTML5, Java, etc.. Tutorials, Videos Free / Paid Easy – Hard
24 Coursera C++, C#, Python, Java, or Ruby Lecture System Free Easy – Intermediate
25 Learn Python the Hardway Python Videos, Discussion $29.95 Hard
26 Lynda WordPress, jQuery, CSS, HTML, PHP Videos, Code Interpreter, Free & Paid Intermediate – Nightmare
27 Coder Dojo How To Code, Develop Websites, Apps, Programs, Games Tutorials, Videos Free Easy – Intermediate
28 P2PU2 School of Webcraft WordPress, jQuery, CSS, HTML, PHP Communities, Webinars Free Easy – Hard
29 Dev Opera Important Bits of coding languages Discussion Free Hard
30 W3C jQuery, CSS, HTML Tutorials Easy – Hard
31 Bloc iOS, Android, UX Videos, Code Interpreter, Paid Intermediate – Nightmare
32 How to Code WordPress, jQuery, CSS, HTML, PHP Videos, Discussion Free Easy – Hard
33 Developers Google WordPress, jQuery, CSS, HTML, PHP, Mobile Videos, Discussion Free Easy – Hard
34 Learnable HTML & CSS, JavaScript, PHP, Ruby, Mobile Videos, Discussion Free Easy – Intermediate
35 Bento Box HTML & CSS, Git, Flask, Bootstrap, Heroku, etc.. Collections, Tutorials Free Easy – Intermediate
36 Try Git Git Octobox Free Easy – Intermediate

I hope above mentioned comparison chart of best websites from where you can easily learn without any hassle and helps you a lot in coding. If we have missed any website, feel free to share it with us by commenting below!

Your experiences for any of these listed websites are highly appreciated. So don't hesitate to discuss.

Picture: Michael Himbeault/Flickr

How Video and Canvas Elements Jointly Create Interactive Video Experiences?

Do you want to create interesting and interactive experiences? Get ready to work with the built-in goodies in HTML5 and combine them to develop the innovative experiences. In this article, we are going to take "non-interactive" mp4 video and can create how to create choose-your-own-adventure-style interactive experience through functionality of the <video> and <canvas> tags.

interactive video experience

Firstly, we have needed a video. It is advisable to start with a short, light one (about 1 minute in length). Now, you have to set up a super basic HTML file:

<!doctype html>
<html>
<head>
<title>
Making an interactive video using Javascript
</title>
</head>
<body>
</body>
</html>

Now, you have to put a pair of video tags in the body section. Here, we are giving an id of “myVideo” and assign a width and height of it. You have to add a source tag between the two video tags that defines the location of the actual file and its type.

After that, you have to add a canvas tag. Please Note: the order is not arbitrary, so if you are placing the video tag below the canvas tag in the code then canvas would be hidden behind the video and interaction with it would be blocked. Give canvas an id of “myCanvas” and give it the same width and height as the video so it overlies completely.

This thing can be done with a few simple lines of CSS. Now, you have to add a pair of <style> tags to the <head> and if you prefer, then create an external separate style sheet. Check out below given code for overlapping the two elements.

<style>
#myVideo,#myCanvas{
position:absolute;
left:0px;
top:0px;
}
</style>

With this, you can set your video and canvas in the top-left corner. If you want to move it around the screen, then you have to tweak the left and top values. Ensure to assign this to both the IDs. Here, we found the powerful transparent wrapper than watch-only video. In next step, we have to set up Javascript file by adding below give lines to the head of your HTML page:

<script src="myScript.js"></script>

In next step, you have to set up a .js file named myScript.js and paste it in the same directory as your HTML file. After that, you have to set up reference the video and the canvas in Javascript. This can be done by inserting lines to the top of myScript.js:

var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d"); 
var video = document.getElementById("myVideo");

Now, we are creating a variable, named as canvas that accesses the HTML <canvas> element through its ID. It’s time to create a second variable that holds the context of the canvas. It will give access to many powerful tools which can be called directly through the variable context. In next step, you have to refer the video tag.

After that, you will see the both elements are fully accessible through Javascript that simply means you don’t have to access all their built-in methods and properties.

Those people, who have an idea about canvas, can easily use it to draw shapes, show images, create animations, etc. You have to draw a rectangle on the canvas by adding this simple code to the script file:

context.fillRect(100,100,50,50);

After that, you have to work with some essential methods and a very important property of the video element, namely:

video.play();
This plays the video, as you can imagine.
video.pause();
This pauses the video.
And…
video.currentTime

It gives current position of the playback that we require to give to mess around with the sequence of our video. Now, you have to create a simple, grey rectangle. But before that you have to create a generic Javascript object that helps with the collision detection later. for that, you just wrote codes given below:

var buttonObject =
 {
   width: 0,
   height: 0,
   x: 0,
   y: 0,
   centerX: function()
   {
     return this.x + (this.width / 2);
   },
   centerY: function()
   {
     return this.y + (this.height / 2);
   },
   halfWidth: function()
   {
     return this.width / 2;
   },
   halfHeight: function()
   {
     return this.height / 2;
   }
 };

After that, you use the Object.create() method and develop our actual button which will inherit the properties of the buttonObject.

var button = Object.create(buttonObject);
button.x = 200;
button.y = 200;

Now, you have to save and run it in your favorite browser and you notice that nothing happens. This is because you haven’t drawn anything yet. Now, you have to specify abstract element’s characters on the screen. You have to follow below given method to draw it,

context.fillStyle = "#333";
context.fillRect(button.x,button.y,button.width,button.height);

One will see a grey (hex value: #333) rectangle on your screen if everything went well above the video. After that, you have to add two event listeners to deal with our mouse activities.

window.addEventListener("mousemove",onMouseMove,false);
window.addEventListener("mousedown",onMouseDown,false);

Now, we have to add a variable to decide whether or not the mouse has been clicked…

var clicked = false;

after that you have to create two simple variables for tracking the X and Y values of the mouse…

var mouseX;
var mouseY;

…and let’s finish it off with their respective handlers:

function onMouseDown(event)
 {
 clicked = true;
 }
 function onMouseMove(event)                {
 mouseX = event.pageX - canvas.offsetLeft;
 mouseY = event.pageY - canvas.offsetTop;
 }

A command will be simply executed by the mousedown when the mouse button is being pressed. Along with clicked, it will let you know if we’ve clicked on button. On other side, constant update on our mouse’s X and Y position will help on the mousemove function. Below given code you have to update on collision detection to add something:

main(); 
function main() { 
window.setTimeout(main,33);
 context.clearRect(0,0,canvas.width,canvas.height);
var vx = mouseX - button.centerX();                      
var vy = mouseY - button.centerY();
var combinedHalfWidths = 1 + button.halfWidth();
var combinedHalfHeights = 1 + button.halfHeight();
 if(Math.abs(vx) < combinedHalfWidths)
 {
    if(Math.abs(vy) < combinedHalfHeights)
    {
//THE RESULT OF THE COLLISION DETECTION GOES HERE… 
 } 
} 
}

Now, you have to do some couple of things. First of all, you have to create a main loop called main() that itself recursively and repeats itself continuously thanks to the setTimeout timer. The canvas is cleared at every call and it will help you to create the illusion of motion. In next step, you have to check the collision between the mouse and the rectangle.

However, one thing is clear that if you run above as is, you will notice the grey rectangle disappears. It is due to the dust back in frame one. In order to have to it obvious, you have to add it to the main loop. Now, you have to go ahead and cut these two lines and paste it to above the collision detection check we wrote:

context.fillStyle = "#333";
context.fillRect(button.x,button.y,button.width,button.height);

Here, you will find a complete code. First the HTML files:

<!doctype html>
<html>
<head>
<title>

Use Javascript to create interactive video:

</title>
 <style>
 #myVideo,#myCanvas {
 position:absolute;
 left:0px;
 top:0px;
 }
 </style>
 <script src="myScript.js"></script>
 <video id="myVideo" width="500" height = "400"> 
 <source src="SampleVideo.mp4" type="video/mp4">
 </video>
 <canvas id="myCanvas" width ="500" height="400"> </canvas>
 </head>
 <body>
 </body>
 </html>

And here’s the JavaScript file (myScript.js):

var buttonObject =
 {
   width: 100,
   height: 100,
   x: 0,
   y: 0,
   centerX: function()
   {
     return this.x + (this.width / 2);
   },
   centerY: function()
  {
     return this.y + (this.height / 2);
   },
   halfWidth: function()
   {
     return this.width / 2;
   },
   halfHeight: function()
   {
     return this.height / 2;
   }
 };
 var canvas = document.getElementById("myCanvas");
 var context = canvas.getContext("2d");
 var video = document.getElementById("myVideo");
 var button = Object.create(buttonObject);
 button.x = 200;
 button.y = 200;
 window.addEventListener("mousemove",onMouseMove,false);
 window.addEventListener("mousedown",onMouseDown,false);
 var clicked = false;
 var mouseX;
 var mouseY;
 function onMouseDown(event)
 {
 clicked = true;
 }
 function onMouseMove(event)                {
 mouseX = event.pageX - canvas.offsetLeft;
 mouseY = event.pageY - canvas.offsetTop;
 }
 main();
 function main() {
 window.setTimeout(main,33);
 context.clearRect(0,0,canvas.width,canvas.height);
 context.fillStyle = "#333";
 context.fillRect(button.x,button.y,button.width,button.height);
 var vx = mouseX - button.centerX();                      
 var vy = mouseY - button.centerY();
 var combinedHalfWidths = 1 + button.halfWidth();
 var combinedHalfHeights = 1 + button.halfHeight();
   if(Math.abs(vx) < combinedHalfWidths)
   {
     if(Math.abs(vy) < combinedHalfHeights)
     {
    }
 //THE RESULT OF THE COLLISION DETECTION GOES HERE…
   }
 }

Now, you have to payoff for clicking on the rectangle. You have to delete the comments in the collision detection formula and add the following:

if(clicked)
 video.play();

After that, you have to run the code and check out what happens when you click on the square. Just for change, you have to change above code with below given code:

if(clicked)  {
    video.currentTime = 10;
    video.play();
    clicked = false;
 }

It will allow to skip forward or back to the 10 second mark every time you click on the box. Another example: You have to add another variable at the top under the mouseY variable:

var buttonVX = 5;

After that, you have to check back in the main loop and add code for collision detection:

video.pause();

Lastly, you have to add some basic mechanics to make the box move from the left to right:

video.play();
 button.x += buttonVX;
 if(button.x > canvas.width - button.width)
 {
 buttonVX = -5;
 }
 if(button.x < 0)
 {
 buttonVX = 5;
 }

This amazing guide helps you to create Interactive Video Experiences with Video and Canvas Elements. For more information you can contact me.