Part I! Web Technologies for Interactive Multimedia



Similar documents
Part I. Web Technologies for Interactive Multimedia

How To Embed A Youtube Video On A Computer Or Ipad Or Ipa Computer Or Tvplayer On A Pc Or Mac Or Ipro Or Ipo Or Ipode Or Iporode On A Mac Or Tvode On Your Computer Or Mac (

Chapter 2: Interactive Web Applications

Differences between HTML and HTML 5

Outline. 1.! Development Platforms for Multimedia Programming!

Web Design Specialist

Research on HTML5 in Web Development

SUBJECT CODE : 4074 PERIODS/WEEK : 4 PERIODS/ SEMESTER : 72 CREDIT : 4 TIME SCHEDULE UNIT TOPIC PERIODS 1. INTERNET FUNDAMENTALS & HTML Test 1

Outline. CIW Web Design Specialist. Course Content

Web Development News, Tips and Tutorials

Web Pages. Static Web Pages SHTML

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

PHP and XML. Brian J. Stafford, Mark McIntyre and Fraser Gallop

Internet Technologies_1. Doc. Ing. František Huňka, CSc.

TIME SCHEDULE OBJECTIVES

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Efficiency of Web Based SAX XML Distributed Processing

Short notes on webpage programming languages

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Web Designing with UI Designing

10CS73:Web Programming

Responsive Web Design Creative License

PHP Skills and Techniques

WEB DESIGN COURSE CONTENT

GLEN RIDGE PUBLIC SCHOOLS MATHEMATICS MISSION STATEMENT AND GOALS

Unlocking the Java EE Platform with HTML 5

JW Player Quick Start Guide

Universal Ad Package (UAP)

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

Introduction. It would appear that. we have reached the. limits of what it is. possible to achieve with. computer technology, although one should be

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

LAMP [Linux. Apache. MySQL. PHP] Industrial Implementations Module Description

Chapter 1 Programming Languages for Web Applications

WEB DEVELOPMENT COURSE (PHP/ MYSQL)

Computer Science. 232 Computer Science. Degrees and Certificates Awarded. A.S. Degree Requirements. Program Student Outcomes. Department Offices

Apache Jakarta Tomcat

LabVIEW Internet Toolkit User Guide

RIA Technologies Comparison

Rweb: Web-based Statistical Analysis

LAMBDA CONSULTING GROUP Legendary Academy of Management & Business Development Advisories

TATJA: A Test Automation Tool for Java Applets

JW Player for Flash and HTML5

IE Class Web Design Curriculum

Fachgebiet Technische Informatik, Joachim Zumbrägel

Introduction to web development and JavaScript

Fig (1) (a) Server-side scripting with PHP. (b) Client-side scripting with JavaScript.

GUI and Web Programming

ActiveX AJAX ASP. AudioMP3

Chapter 10: Multimedia and the Web

Rich User Interfaces for Web-Based Corporate Applications

Client-side Web Engineering From HTML to AJAX

Entrance exam for PBA in Web Development

A review and analysis of technologies for developing web applications

IT3503 Web Development Techniques (Optional)

JavaScript: Client-Side Scripting. Chapter 6

4 Understanding. Web Applications IN THIS CHAPTER. 4.1 Understand Web page development. 4.2 Understand Microsoft ASP.NET Web application development

Software Requirements Specification For Real Estate Web Site

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 02 Minor Subject

JavaFX Session Agenda

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9.

Course Outline Basic Web Development

XBMC Architecture Overview

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

HTML5. Turn this page to see Quick Guide of CTTC

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

Programming IoT Gateways With macchina.io

If your organization is not already

MO 25. Aug. 2008, 17:00 UHR RICH INTERNET APPLICATIONS MEHR BISS FÜR WEBANWENDUNGEN

HTML5 - Key Feature of Responsive Web Design

ASP.NET: THE NEW PARADIGM FOR WEB APPLICATION DEVELOPMENT

Whitepapers at Amikelive.com

Google Web Toolkit. Progetto di Applicazioni Software a.a. 2011/12. Massimo Mecella

IT3504: Web Development Techniques (Optional)

Developing Your School Website

HTML5 & CSS3. Jens Jäger Freiberuflicher Softwareentwickler JavaEE, Ruby on Rails, Webstuff Blog: Mail: mail@jensjaeger.

SKILLS HIGHLIGHTS: W e b a n d G r a p h i c D e s i g n e r

Performance Comparison of Database Access over the Internet - Java Servlets vs CGI. T. Andrew Yang Ralph F. Grove

Performance Testing Web 2.0. Stuart Moncrieff (Load Testing Guru) /

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Business & Computing Examinations (BCE) LONDON (UK)

Web Programming Languages Overview

Advantage of Jquery: T his file is downloaded from

By Kundan Singh Oct Communication

Computer Science. Computer Science 207. Degrees and Certificates Awarded. A.S. Computer Science Degree Requirements. Program Student Outcomes

4.2 Understand Microsoft ASP.NET Web Application Development

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Systems Analysis Input and Output 1. Input and Output

QuickTime, iphone, ipad and ipod are either registered trademarks or trademarks of Apple, Inc. in the United States and/or other countries.

Chapter 1. Introduction to web development

Chapter 2: Interactive Web Applications

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE TITLE: CS WEB DEVELOPMENT AND PROGRAMMING FUNDAMENTALS

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE NUMBER CS WEB DEVELOPMENT & PROGRAMMING I AND TITLE:

ISI ACADEMY Web applications Programming Diploma using PHP& MySQL

BreezingForms Guide. 18 Forms: BreezingForms

CSET 3100 Advanced Website Design (3 semester credit hours) IT Required

Skills for Employment Investment Project (SEIP)

A set-up guide and general information to help you get the most out of your new theme.

Macromedia Dreamweaver 8 Developer Certification Examination Specification

Transcription:

Multimedia im Netz! Online Multimedia Wintersemester 2014/2015 Part I!! Web Technologies for Interactive Multimedia 1

Chapter 2: Interactive Web Applications 2.1! Interactivity and Multimedia in the WWW architecture! 2.2! Client-Side Interactivity and Multimedia! (Example HTML5)! 2.3! Interactive Server-Side Scripting (Example PHP)! 2.4! Data Storage in Web Applications! (Example Database Access in PHP)! 2.5! Integrated Server/Client-Side Scripting! (Example jquery/ajax) 2

Dynamic Web Contents Content shown to user in browser is dependent on some external variables! Examples of external variables:! Date and time! Contents of an information archive (e.g. recent news)! Actions of the user!» Pointing to elements!» Clicking at a certain position!» Filling out forms! Wide-spread applications:! E-Commerce! Interpersonal communication media (forums, discussion boards)! Mass media (news and other information services) 3

Server-Side vs. Client-Side Realisation Browser Request Response Web-! Server Browser Request Response Web-! Server Script Client-side realization:! Browser contains execution engine for scripts! Web server does not need to execute scripts! Script is sent to client as part of server response! Example: JavaScript Server-side realization:! Web server contains execution engine for scripts! Browser does not need to execute scripts! Script is executed on server and computes response to client! Example: PHP 4

Server Scripts vs. Client Scripts Client-Side Scripts (e.g. JavaScript) Fast reaction times good for fluid interaction! Works also without network connectivity! Independent of server software Computation of page contents dependent on external variables Server-Side Scripts! (e.g. PHP) Data storage on server good for accessing media archives! Access to central resources (e.g. for request processing)! Independent of browser software 5

Web Architectures for Interactivity Early approaches: Common Gateway Interface (CGI)! Informally defined, programs invoked to create HTML code! Drawbacks: Security problems, high processor load (separate process)! Later: Web server software add-ons! Interfaces to common scripting and programming languages e.g. Java, Perl, Ruby, PHP! Scripting languages specifically designed for Web development e.g. PHP! Web server software integrated with specific execution environments ( Application Server )! Complex, highly optimized for good throughput! e.g. Servers for Java Enterprise Edition, Microsoft.NET framework! Trend: Web servers written in I/O-efficient languages! e.g. Express server written in JavaScript (Node.js) 6

Media Support Functions of Client Only Client Server Web! Browser Network Media rendering:! Recognition of media file types!» MIME registry of browser! Local media playing software!» Plugins or separate programs! Interactivity:! Local interactions!» Highlighting, dynamic menus etc. 7

Media Support Functions by Server Only Client Server Web! Browser Network Media rendering:! Storage of media files and meta-information! Indexing and querying! Interactivity:! Interactions with server-side effect!» E.g. database updates (registration, buying,...)! Interactions with global effect for all users!» E.g. adding a comment, uploading a video 8

Media Support Functions by Client & Server Client Server Web! Browser Network Media streaming:! Playback of incomplete content in client! Play-out in defined order from server! Synchronization, rate control, buffering! Flow control (stop, start, pause)! Adaptation to network conditions! Interactivity:! Near real-time interactions!» E.g. status notifications, data ticker 9

Chapter 2: Interactive Web Applications 2.1! Interactivity and Multimedia in the WWW architecture! 2.2! Client-Side Interactivity and Multimedia! (Example HTML5)! 2.3! Interactive Server-Side Scripting (Example PHP)! 2.4! Data Storage in Web Applications! (Example Database Access in PHP)! 2.5! Integrated Server/Client-Side Scripting! (Example jquery/ajax) Literature:!! B. Lawson, R. Sharp: Introducing HTML5, New Riders 2011!! S. Fulton, J. Fulton: HTML5 Canvas, 2nd ed., O Reilly 2013 10

Embedding Media in HTML Media embedding requires:! Media data (a file)! Player software! Typical media data:! Sound files (e.g..wav,.mp3,.ogg,.midi)! Movie files (e.g..avi,.mov,.ogv,.flv)! Programs to be executed on a virtual machine ( universal player ), e.g.:!» Java applets!» Flash runtime code (Shockwave Flash,.swf)!» Silverlight application packages (.xap)! Browser integration:! Built-in: Browser "knows" about player for media type! Plug-in: Flexible association between player and media type! Incompatibilities in older versions of HTML! embed by Netscape, object by W3C & Microsoft, strange combinations! 11

HTML 5 HTML Version 5! Draft W3C standard (most recent draft 25 October 2012)! Developed in parallel to XHTML 1.0!» XHTML 2.0 development has been stopped!» XML representation of HTML5 exists ("DOM5")! HTML 5 is partially supported already by most modern browsers! HTML 5 contains standardized and simple media embedding tags! audio! video! embed 12

Audio Embedding in HTML 5 Example:! <html>...! <body>!!...!!<audio src="nightflyer.ogg" autoplay>!! Your browser does not support the <code>audio</code> element.!!</audio>!!! Attributes (examples):! autoplay: Playback starts automatically! controls: Control UI elements are made visible! loop: Plays in an endless loop! preload: Hints about preloading expectations! Subelement <source>:! Alternative way to specify data source! Multiple occurrence is possible, first supported version is taken 13

Video Embedding in HTML 5 Example:! <html>! <body>! <video controls>!! <source src="big_buck_bunny_480p_stereo.ogg" type="video/ogg">!! <source src="big_buck_bunny_480p_h264.mov" type="video/quicktime">! Your browser does not support the <code>video</code> element.! </video>!! Additional Attributes compared to <audio> (examples):! height, width: Dimensions of video image! poster: Image to be shown until first frame becomes available! Events (can be handled e.g. with JavaScript, examples):! empty! canplay! ended! abort! volumechange 14

<embed> in HTML 5 HTML 5 contains a standardized version of the <embed> element! Purpose:! Embed arbitrary content played back via plug-in software! Examples:! Flash content! Java applets! Not intended for media playback 15

Video Codecs and HTML5 Video HTML5 Working Group: All browsers should support at least one common video format! Good quality & compression, hardware-supported, royalty-free!! Problems with mainstream formats:! Patents on H.264 and its successor HEVC/H.265! Fear of hidden patents for Ogg Theora! Google:! Release of WebM to the public (after purchase of On2)! WebM container format based on Matroska container! VP8 video format with Vorbis audio (current)! VP9 video format with Opus audio (in preparation), open, royalty-free! Patent battle between Google and Nokia on VP8! Still no simple common solution for the key manufacturers available! Neither H.264 nor VP8 fully supported by all browsers on all platforms! H.264 appears to be in the best position currently 16

Client-Side Interactivity with HTML5 Browser-executed scripting languages! JavaScript, mainly! Processing of user input! Event handling for mouse and keyboard input! Additional controls! 2D graphics drawing! canvas element! Animations! JavaScript frameworks, e.g. jquery or JSCreate 17

HTML5 Interactive Controls Standard controls for interactive applications have been integrated into HTML5! range element (slider control)! color element (interactive color picker)! Potential:! Higher client-side (stand-alone) interactivity! Typical applications: Drawing, image editing! See discussion of canvas element below 18

Example: Slider in HTML5 <!DOCTYPE html> slider.html! <html> <head> <title>slider in HTML5</title> <style type="text/css"> input[type=range]::before {content: attr(min)} input[type=range]::after {content: attr(max)} input[type=range] {width:500px; color:red; font-size:1.5em;} </head> </style> <body oninput="current.value=slider.value"> <input name="slider" type="range" min="1" max="11"/> <output name="current">5</output> </body> </html> 19

HTML5 Canvas HTML5 Canvas is an immediate mode bitmapped area of the screen that can be manipulated with JavaScript. (Fulton/Fulton)! 2D Drawing Context:! Object associated with a Canvas object! Used as handler in JavaScript to address the canvas (drawing API)! Typical drawing primitives:! Draw shapes! Render text! Display images! Apply colors, rotations, transparency, pixel manipulations, fills, strokes! (Pure) Canvas works on (low) pixel level! Browser redraws whole canvas each time the Canvas is modified using JavaScript! Retained mode rendering is provided by JavaScript libraries (e.g. EaselJS, part of CreateJS, see http://www.createjs.com) 20

Example: Drawing on the Canvas <!doctype html> <html> <head> <title>canvas Hello World</title> <script type="text/javascript"> window.addeventlistener("load", drawscreen, false); function drawscreen() { var c = document.getelementbyid("thecanvas"); var ctx = c.getcontext("2d"); ctx.fillstyle = "lightgrey"; ctx.fillrect(0, 0, c.width, c.height); ctx.font = "italic bold 32px sans-serif"; ctx.fillstyle = "red"; ctx.filltext("hello World!", 50, 50); } </script> </head> <body> <canvas id="thecanvas" width=300 height=80> Your browser does not support Canvas! </canvas> </body> canvashello.html 21

Example: Interactive Gradient (1) <!doctype html> <html> <head> <title>canvas Gradient Fill</title> <meta charset="utf-8"> <script type="text/javascript"> window.addeventlistener("mousemove", drawscreen, false); function drawscreen(event) { var c = document.getelementbyid("thecanvas"); var ctx = c.getcontext("2d"); var mx = Math.min(event.clientX,c.width); var my = Math.min(event.clientY,c.height); var grad = ctx.createradialgradient(mx, my, 0, mx, my, c.width*1.5); grad.addcolorstop(0,"#f00"); grad.addcolorstop(1,"#00f"); ctx.fillstyle = grad; ctx.fillrect(0, 0, c.width, c.height); } </script> gradient.html 22

Example: Interactive Gradient (2)...! <body> <canvas id="thecanvas" width=500 height=500> Your browser does not support Canvas! </canvas> </body> </html> 23

Chapter 2: Interactive Web Applications 2.1! Interactivity and Multimedia in the WWW architecture! 2.2! Client-Side Interactivity and Multimedia! (Example HTML5)! 2.3! Interactive Server-Side Scripting (Example PHP)! 2.4! Data Storage in Web Applications! (Example Database Access in PHP)! 2.5! Integrated Server/Client-Side Scripting! (Example jquery/ajax) 24

Server-Side Script Language PHP (Only an example for a server-side script language!)! PHP:! Personal Home Page Toolkit!» 1995, Rasmus Lerdorf!» 2003, new by Zeev Suraski, Andi Gutmans! PHP Hypertext Preprocessor (recursive acronym, backronym)! Current version: 5.6.1 (October 2014) [version 6 has been stopped]! OpenSource project:! see www.php.net! Can be used and modified freely (PHP license)! Syntax loosely oriented towards C! Variations of possible syntax! Extensive function library! being extended by community! Advanced and popular Web development frameworks based on PHP 25

Prerequisites for Using PHP in Practice Always (even if using just one computer)! Installation of a Web server!» OpenSource: Apache!» Microsoft Internet Information Server! Invocation of PHP always indirectly by loading pages from server (http://...)!» Loading from local computer: http://localhost/...! Installation of PHP software as plug-in for used Web server! Very often also installation of a data base system (e.g. MySQL)! Frequently used acronyms for specific configurations:! LAMP: Linux, Apache, MySQL, PHP! WIMP: Windows, Internet Information Server, MySQL, PHP! MOXAMP: MacOS X, Apache, MySQL, PHP 26

Activation of PHP Module in Apache Example (MacOS X):! Apache + PHP module are pre-installed! Apache server needs to be started...! Configuration needs to be updated (remove a comment sign)! /etc/apache2/httpd.conf:!! # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.... LoadModule bonjour_module LoadModule php5_module #LoadModule fastcgi_module libexec/apache2/mod_bonjour.so libexec/apache2/libphp5.so libexec/apache2/mod_fastcgi.so 27

Hello World in PHP <!DOCTYPE html>! <html> <head> <title>hello World with PHP</title> </head>! <body> <h1> <?php echo "Hello World!";?> </h1> </body> </html> File hello.php! in Web server directory 28

Embedding of PHP into HTML XML style (used here):! Like Processing Instructions in XML! <?php PHP Text?> SGML style:! Widely used in older scripts! Not really recommendable: PHP language not specified! <? PHP Text?> HTML style:! Using HTML tag:! <script language="php"> PHP Text </script> 29

PHP Syntax (1) Inheritance from shell scripts! Variables start with "$"! Some UNIX commands part of the language, e.g.:!! echo "Hello"; Control statements exist in different versions, e.g.:! if (bedingung1) anw1 elseif (bedingung2) anw2 else anw3;! if (bedingung1): elseif (bedingung2): else: endif; anwfolge1 anwfolge2 anwfolge3 30

PHP Syntax (2) Various comment styles:! One-line comment, C style:! echo "Hello"; // Hello World One-line comment, Perl style / Unix shell style:! echo "Hello"; # Hello World "One line" ends also at end of PHP block! Multi-line comment, C-style:! echo "Hello"; /* Comment spreads over multiple lines */ Do not create nested C-style comments!!! Instruction must always be terminated with ";"! Exception: end of PHP block contains implicit ";" 31

PHP Type System Scalar types:! boolean, integer, float (aka double), string! Compound types:! array, object! Special types:! resource, NULL! Resource type: refers to external resource, like a file!! "The type of a variable is not usually set by the programmer; rather, it is decided at runtime by PHP depending on the context in which that variable is used."!!! (PHP Reference Manual) 32