search
HomeWeb Front-endH5 TutorialLi Yanhui HTML5 video data sharing

Li Yanhui HTML5 video data sharing

Aug 31, 2017 am 11:57 AM
h5html5

Study the "Li Yanhui HTML5 Video Tutorial" video tutorial, which will introduce you to HTML5 in detail. HTML5 is the fifth major revision of Hypertext Markup Language (HTML), that is, the latest version; it adds some new features than the original standard. tags to achieve more functions, be more standardized, and be more suitable for mobile Internet.

Li Yanhui HTML5 video data sharing

Video playback address: http://www.php.cn/course/365.html

Difficulties of this course It lies in the new content in HTML5 and the usage of canvas:

Many drawing effects are achieved using canvas, so learning canvas well is the key to learning HTML5 well.

1. Introduction to canvas

1.1 What is canvas?

is an important element in HTML5. Similar to audio and video elements, it can run without any external plug-ins.

The Chinese translation of Canvas is "canvas". It provides powerful graphics. Processing functions (drawing, transformation, pixel processing...).

But it should be noted that the canvas element itself does not draw graphics, it is just equivalent to an empty canvas.

If developers need to draw graphics on the canvas, they must use JavaScript scripts to draw.

1.2 What can canvas do?

Drawing of basic graphics

Drawing of text

Deformation of graphics and synthesis of pictures

Processing of pictures and videos

Animation Implementation

Production of small games

1.3 Supported browsers

Most modern browsers support Canvas, such as Firefox, safari, chrome, and opera recently Versions and IE9 are supported.

IE8 and below do not support HTML5, but we can prompt users to update to the latest version

1.4 Basic concepts about canvas tags

In Defining the canvas element on an HTML page is no different from defining other ordinary elements. In addition to specifying common attributes such as id, style, class, hidden, etc., it can also set the width and height attributes.

Why do you have to say this specifically?

We will explain in detail in Chapter 2.2.

In addition, after we define the canvas element in the web page, it is just a blank canvas. If you want to draw on the canvas, you must go through the following steps.

Get the DOM object corresponding to the canvas element, which must be a canvas object

Call the getContext() method of the canvas object, which returns a canvasRenderingContext2D object, which can draw graphics.

Call the method of canvasRenderingContext2D object to draw.

Then let’s start our canvas practice and see how canvas can draw graphics.

2. Canvas actual combat

2.1 Check the current browser support for canvas

We also explained above that some of our browsers do not support canvas. What should we do at this time?

At this time we can write content directly between the canvas tags. The advantage of this is that when your browser does not support canvas, we can display the content between the tags, as follows.

<!DOCTYPE html>
<html>
 <head> 
  <meta charset="UTF-8" /> 
  <title>Document</title> 
  <style type="text/css">         
  html,body{     
          margin: 0px;   
       }         
    canvas{           
      background: #ccc;     
          }     
    </style> 
 </head> 
 <body> 
  <canvas>
    我们在设置 canvas 之前需要首先监测用户电脑是否支持 canvas 
  </canvas>  
 </body>
</html>

Now that the specific content has been created, can we see it now?

Although we have not given the width and height of the canvas, our canvas is actually visible on the page.

It should be noted that the width and height of the canvas default style are 300px * 150px.

Even if we do not set the specific width and height, it can still be displayed.

<!DOCTYPE html>
<html>
 <head> 
  <meta charset="UTF-8" /> 
  <title>Document</title> 
  <style type="text/css">   
  html,body{    
  margin: 0px;   
  }   
  canvas{    
  background: #ccc;   
  }  
  </style> 
 </head> 
 <body> 
  <canvas>
    我们在设置 canvas 之前需要首先监测用户电脑是否支持 canvas 
  </canvas>   
 </body>
</html>

The above is the detailed content of Li Yanhui HTML5 video data sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
H5: New Features and Capabilities for Web DevelopmentH5: New Features and Capabilities for Web DevelopmentApr 29, 2025 am 12:07 AM

H5 brings a number of new functions and capabilities, greatly improving the interactivity and development efficiency of web pages. 1. Semantic tags such as enhance SEO. 2. Multimedia support simplifies audio and video playback through and tags. 3. Canvas drawing provides dynamic graphics drawing tools. 4. Local storage simplifies data storage through localStorage and sessionStorage. 5. The geolocation API facilitates the development of location-based services.

H5: Key Improvements in HTML5H5: Key Improvements in HTML5Apr 28, 2025 am 12:26 AM

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

HTML5: The Standard and its Impact on Web DevelopmentHTML5: The Standard and its Impact on Web DevelopmentApr 27, 2025 am 12:12 AM

The core features of HTML5 include semantic tags, multimedia support, offline storage and local storage, and form enhancement. 1. Semantic tags such as, etc. to improve code readability and SEO effect. 2. Simplify multimedia embedding with labels. 3. Offline storage and local storage such as ApplicationCache and LocalStorage support network-free operation and data storage. 4. Form enhancement introduces new input types and verification properties to simplify processing and verification.

H5 Code Examples: Practical Applications and TutorialsH5 Code Examples: Practical Applications and TutorialsApr 25, 2025 am 12:10 AM

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

The Connection Between H5 and HTML5: Similarities and DifferencesThe Connection Between H5 and HTML5: Similarities and DifferencesApr 24, 2025 am 12:01 AM

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.

The Building Blocks of H5 Code: Key Elements and Their PurposeThe Building Blocks of H5 Code: Key Elements and Their PurposeApr 23, 2025 am 12:09 AM

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.

HTML5 and H5: Understanding the Common UsageHTML5 and H5: Understanding the Common UsageApr 22, 2025 am 12:01 AM

There is no difference between HTML5 and H5, which is the abbreviation of HTML5. 1.HTML5 is the fifth version of HTML, which enhances the multimedia and interactive functions of web pages. 2.H5 is often used to refer to HTML5-based mobile web pages or applications, and is suitable for various mobile devices.

HTML5: The Building Blocks of the Modern Web (H5)HTML5: The Building Blocks of the Modern Web (H5)Apr 21, 2025 am 12:05 AM

HTML5 is the latest version of the Hypertext Markup Language, standardized by W3C. HTML5 introduces new semantic tags, multimedia support and form enhancements, improving web structure, user experience and SEO effects. HTML5 introduces new semantic tags, such as, ,, etc., to make the web page structure clearer and the SEO effect better. HTML5 supports multimedia elements and no third-party plug-ins are required, improving user experience and loading speed. HTML5 enhances form functions and introduces new input types such as, etc., which improves user experience and form verification efficiency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment