BogoToBogo
  • Home
  • About
  • Big Data
  • Machine Learning
  • AngularJS
  • Python
  • C++
  • go
  • DevOps
  • Kubernetes
  • Algorithms
  • More...
    • Qt 5
    • Linux
    • FFmpeg
    • Matlab
    • Django 1.8
    • Ruby On Rails
    • HTML5 & CSS

HTML5 Tutorial - Multimedia Before HTML5 - 2020

HTML5-Number5.png




Bookmark and Share





bogotobogo.com site search:




Multimedia and Web - Before HTML5

In this chapter, we're going to review the techniques related to the multimedia on the web before we have HTNML5. So, it's about the multimedia with HTML4.


As we already know, one of the major advantages of the HTML5 video element is that video is a full-fledged citizen on the Web. Now, <video> elements can be styled with CSS. They can be resized on hover using CSS transitions. They can be tweaked and redisplayed onto <canvas> with JavaScript. Also, <embed> is finally standardized in HTML5. It was never part of any previous flavor of (X)HTML.

Best of all, the innate flexibility that open web standards provide is opened up. Before HTML5, all our data was locked. Now, however, we can freely manipulate the data whatever we want.

Anyway, HTML4 is still everywhere and widely used, I think, it's still worth reviewing the HTML4's multimedia.

A browser is an application with limited capability of playing multimedia. It can show text and images. But there are quite a few different types of files round the web including video, auto, PDFs, Flash, and so on.

To display or to play these types of files, a browser needs help from the application called players. The players are stand-alone that function as separate programs on the visitor's computer as well as plugin players which can work inside the browser.

There are two ways of playing them:

  1. When we link to a multimedia file, that file is opened in an external player.
  2. When we embed a multimedia file, the file is opened in the plugin within the browser itself.

Common plugins are:

  1. Flash/Shockwave Players from Macromedia
  2. QuickTime Player from Apple
  3. Windows Media Player from Microsoft
  4. Acrobat from Adobe

When a browser encounters a file it can't open on its own, it starts to look for a player or a plugin on the client computer. On most browsers, if the client has an appropriate plugin installed, the multimedia file will be opened in a new window with an embedded player. If the client does not have an appropriate plugins but does have a player, the linked file in opened in the external player. And if there is neither a plugin nor a player available, most browsers will let visitors download the file and/or choose another program with which to open it.

Before HTML5, if developers wanted to include video in a web page, they had to use the object element, which is a generic container for foreign objects. However, due to the browser inconsistencies, they would also need to use the invalid embed element and duplicate many parameters.




Video Media Types

Flash movies (.swf), AVI's (.avi), and MOV's (.mov) file types are supported by the embed tag.

  1. .swf (ShockWave Flash)
    file types created by Macromedia's Flash program.
  2. .asf, .wmv, .wm, .wma
    Microsoft's Window's Media file types.
    1. Advanced Systems Format (.asf)
    2. Windows Media Video (.wmv, .wm)
    3. Windows Media Audio (.wma)
  3. .mov, .qt
    Apple's Quick Time Movie format.
  4. .mpg, .mpeg, .m1v, .mp2, .mp3, .mpa, .mpe, .mpv2, .m3u
    The Moving Picture Experts Group develop the Moving Picture Experts Group (MPEG) standards. These standards are an evolving set of standards for video and audio compression.

The listings above are the most commonly used formats for the internet. .mpeg files and Macromedia's .swf files are the most compact and widely used among the internet.




Object vs. Embed

There are two primary elements used to embed multimedia on a web page: object and embed.

The embed element stared out as a Netscape extension and is not a part of the (X)HTML specifications. Any page that contains it is not considered valid. However, it continues to be generally supported.

On the other side, we have the W3C's object element as an official component of HTML4 and XHTML 1.0.. But IE implements the object in a way that makes other browsers ignore it - in order to use its ActiveX controls. On top of that, IE does not completely support the object element itself, failing - as the (X)HTML specifications require-to look for nested objects that it can support when the outer object proves too difficult.

The solution historically has been to offer IE and object element in the non-standard way that it requires for its ActiveX controls while at the same time nesting a non-standard embed element within the object element that the rest of the browser population can handle.

We're going to use nested object and if statement for IE to address the mixed situation (using embed within object).




Embedding QuickTime Movie Using Object with If for IE

Internet Explorer (IE) uses the standard object element in a non-standard way that it makes all other browsers ignore it. The object element, however, is intended as an all-purpose tag to embed external files into web pages. It has clever features such as being able to be nested, so that if a browser does not understand what is meant by the outer element, it can parse the inner element instead. This means that the inner most element could contain an image, which would be rendered to the user if all else fails.

So, we should be able to use the outer object for IE and an inner one for other browsers. But IE gets this wrong too. IE does erroneously display two objects element, both inner and outer. The solution is to hide the nested elements from IE using conditional comments:

<!--[if !IE]>-->
...
<!--<![endif]-->

Here is the html code:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="//www.apple.com/qtactivex/qtplugin.cab" width="320"
height="260">
    <param name="src" value="http://www.bogotobogo.com/HTML5/images/files/mov_sample.mov" /> 
    <param name="controller" value="true" /> 
    <param name="autoplay" value="true" />
<!--[if !IE]>-->
<object type="video/quicktime" 
	data="http://www.bogotobogo.com/HTML5/images/files/mov_sample.mov" 
        width="320" height="260">
        <param name="autoplay" value="true" />
        <param name="controller" value="true" />
        <param name="bgcolor" value="#EBF4F3" />
        </object>
<!--<![endif]-->
</object>

If we just want to link it:

<a href="http://www.bogotobogo.com/HTML5/images/files/mov_sample.mov">mov_sample.mov</a>
mov_sample.mov

We can adjust the size of a QuickTime movie:

<param name="scale" value="factor" />

The factor is:

  1. tofit When we want the movie to be reduced or expanded to fit its box.
  2. aspect When we want the movie to be reduced or expanded to fit its box while maintaining its original proportions.
  3. n n is the number with which the original height and width of the movie will be multiplied to get the final height and width.


We can also change the background color of a QuickTime movie:

<param name="bgcolor" value="color" />


We can also make a QuickTime movie to loop :

<param name="loop" value="true" />





Embedding QuickTime using Embed Element




embed



Embedding Windows Media

Microsoft likes us to embed Windows Media with the classid attribute that calls the ActiveX control. But because the classid attribute is non-standard, it causes other browser to ignore the object. Therefore, here, we'll use a standard-compliant way of embedding Window Media files that works on all major browsers.


<object type="video/x-ms-wmv" data="http://www.bogotobogo.com/HTML5/images/files/wmv_sample.wmv" width="320"
height="260" >
<param name="src" value="http://www.bogotobogo.com/HTML5/images/files/wmv_sample.wmv" />
<param name="autostart" value="false" />
<param name="controller" value="true" />
<param name="qtsrcdontusebrowser" value="true" />
<param name="enablejavascript" value="true" />
<a href="http://www.bogotobogo.com/HTML5/images/files/wmv_sample.wmv">Windows Media Video Sample</a>

.wmv (Windows Media Video)

Windows Media Video Sample



.wma (Windows Media Audio)

Windows Media Audio Sample

.wav (Audio for Windows )

Audio for Windows



.mpeg (Moving Picture Experts Group)

Moving Picture Experts Group (MPEG)





Embedding Flash

Flash is an animated image format from Macromedia (Adobe) that is widely used on the web.

Many people use a combination of object and the non-standard embed tag to insert Flash on a web page.

<object type="application/x-shockwave-flash"
data="http://www.bogotobogo.com/HTML5/images/files/swf_sample.swf" 
width="300" height="240">
<param name="movie" 
value="http://www.bogotobogo.com/HTML5/images/files/swf_sample.swf" />
</object>




Or just a link:

swf_sample.swf




Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization

YouTubeMy YouTube channel

Sponsor Open Source development activities and free contents for everyone.

Thank you.

- K Hong







HTML5 & Javascript



Why HTML5?

HTML 5 Tutorial

Introduction

New Semantic Elements

Canvas

Forms

Offline Storage

Geolocation

Video and Audio

Video and Audio - Before HTML5

CSS

Updating a span when input text changes using DOM API, jQuery, and Backbone

Javascript : text input and event listener




Sponsor Open Source development activities and free contents for everyone.

Thank you.

- K Hong









Data Visualization



Data Visualization Tools

Basics of HTML DOM and D3

Basic D3 Drawings

Data Visualization D3.js

Inscribe triangle with animation

Data Visualization - List of D3.js samples







AngularJS



Introduction

Directives I - ng-app, ng-model, and ng-bind

Directives II - ng-show, ng-hide, and ng-disabled

Directives III - ng-click with toggle()

Expressions - numbers, strings, and arrays

Binding - ng-app, ng-model, and ng-bind

Controllers - global controllers, controller method, and external controllers

Data Binding and Controllers (Todo App)

Todo App with Node

$scope - A glue between javascript (controllers) and HTML (the view)

Tables and css

Dependency Injection - http:fetch json & minification

Filters - lower/uppercase, currenty, orderBy, and filter:query with http.get()

$http - XMLHttpRequest and json file

Module - module file and controller file

Forms

Routes I - introduction

Routes II - separate url template files

Routes III - extracting and using parameters from routes

Routes IV - navigation between views using links

Routes V - details page

AngularJS template using ng-view directive : multiple views

Nested and multi-views using UI-router, ngRoute vs UI-router

Creating a new service using factory

Querying into a service using find()

angular-seed - the seed for AngularJS apps

Token (JSON Web Token - JWT) based auth backend with NodeJS

Token (JSON Web Token - JWT) based auth frontend with AngularJS

Twitter Bootstrap

Online resources - List of samples using AngularJS (Already launched sites and projects)

Meteor Angular App with MongoDB (Part I)

Meteor Angular App with MongoDB (Part II - Angular talks with MongoDB)

Meteor Angular App with MongoDB (Part III - Facebook / Twitter / Google logins)

Scala/Java Play app with Angular

Laravel 5 / Angular Auth using JSON Web Token (JWT) - Prod

Scala/Java Play app with Angular





Node.JS



Node.js

MEAN Stack : MongoDB, Express.js, AngularJS, Node.js

MEAN Stack Tutorial : Express.js with Jade template

Building REST API with Node and MongoDB

Nginx reverse proxy to a node application server managed by PM2

Jade Bootstrap sample page with Mixins

Real-time polls application I - Express, Jade template, and AngularJS modules/directives

Real-time polls application II - AngularJS partial HTML templates & style.css

Node ToDo List App with Mongodb

Node ToDo List App with Mongodb - II (more Angular)

Authentication with Passport

Authentication with Passport 2

Authentication with Passport 3 (Facebook / Twitter Login)

React Starter Kit

Meteor app with React

MEAN Stack app on Docker containers : micro services

MEAN Stack app on Docker containers : micro services via docker-compose





Ruby on Rails



Ruby On Rails Home

Ruby - Input/Output, Objects, Load

Ruby - Condition (if), Operators (comparison/logical) & case statement

Ruby - loop, while, until, for, each, (..)

Ruby - Functions

Ruby - Exceptions (raise/rescue)

Ruby - Strings (single quote vs double quote, multiline string - EOM, concatenation, substring, include, index, strip, justification, chop, chomp, split)

Ruby - Class and Instance Variables

Ruby - Class and Instance Variables II

Ruby - Modules

Ruby - Iterator : each

Ruby - Symbols (:)

Ruby - Hashes (aka associative arrays, maps, or dictionaries)

Ruby - Arrays

Ruby - Enumerables

Ruby - Filess

Ruby - code blocks and yield

Rails - Embedded Ruby (ERb) and Rails html

Rails - Partial template

Rails - HTML Helpers (link_to, imag_tag, and form_for)

Layouts and Rendering I - yield, content_for, content_for?

Layouts and Rendering II - asset tag helpers, stylesheet_link_tag, javascript_include_tag

Rails Project

Rails - Hello World

Rails - MVC and ActionController

Rails - Parameters (hash, array, JSON, routing, and strong parameter)

Filters and controller actions - before_action, skip_before_action

The simplest app - Rails default page on a Shared Host

Redmine Install on a Shared Host

Git and BitBucket

Deploying Rails 4 to Heroku

Scaffold: A quickest way of building a blog with posts and comments

Databases and migration

Active Record

Microblog 1

Microblog 2

Microblog 3 (Users resource)

Microblog 4 (Microposts resource I)

Microblog 5 (Microposts resource II)

Simple_app I - rails html pages

Simple_app II - TDD (Home/Help page)

Simple_app III - TDD (About page)

Simple_app IV - TDD (Dynamic Pages)

Simple_app V - TDD (Dynamic Pages - Embedded Ruby)

Simple_app VI - TDD (Dynamic Pages - Embedded Ruby, Layouts)

App : Facebook and Twitter Authentication using Omniauth oauth2

Authentication and sending confirmation email using Devise

Adding custom fields to Devise User model and Customization

Devise Customization 2. views/users

Rails Heroku Deploy - Authentication and sending confirmation email using Devise

Deploying a Rails 4 app on CentOS 7 production server with Apache and Passenger I

Deploying a Rails 4 app on CentOS 7 production server with Apache and Passenger II

OOPS! Deploying a Rails 4 app on CentOS 7 production server with Apache and Passenger (Trouble shooting)











Contact

BogoToBogo
contactus@bogotobogo.com

Follow Bogotobogo

About Us

contactus@bogotobogo.com

YouTubeMy YouTube channel
Pacific Ave, San Francisco, CA 94115

Pacific Ave, San Francisco, CA 94115

Copyright © 2024, bogotobogo
Design: Web Master