•  


3. Web APIs | MDN Curriculum

3. Web APIs

Scripting

Extensions modules

This module covers common aspects of three of the most common classes of Web APIs that we haven't previously covered in any kind of detail, providing a useful grounding for those who want to go deeper into browser API usage.

General notes :

  • This module does not attempt to exhaustively cover the full spectrum of APIs available in web browsers.
  • Rather, it provides you with enough information to understand Web APIs in general, and be able to pick up new ones via your own research.

General resources:

3.1 Video and audio APIs

Learning outcomes:

  • General concepts:
    • Understand the different types of video and audio formats.
    • Understand codecs.
    • Understand key functionality associated with audio and video ? play, pause, stop, seeking backward and forward, duration, and current time.

    Notes :

    • This set of conformance criteria does not expect a successful student to understand all of the web platform's video and audio-related APIs in detail. There is a lot of functionality in this category, and learning it all upfront would not be practical or particularly useful. Some of the functionality is for niche use cases, and students are encouraged to learn more as part of their constant learning, or when the need arises.
    • For now, you are expected to understand the concepts behind video and audio on the web, the basic core API functionality, and the purpose of some of the more advanced APIs.
  • Using the HTMLMediaElement API to build a basic custom media player:
    • Understand why you'd do this ? your target audience might have specific needs not addressed by the browser defaults.
    • One good example is that some browser default controls are not very keyboard accessible.
    • Another is that you might just want a consistent UI design across browsers.
  • Using media streams/ getUserMedia() to capture video and audio from a local device.
  • Handling common errors related to media delivery:
    • Using <source> elements to handle multiple formats.
    • Using the correct MIME type.
    • Showing fallback content if the media is not supported.
  • Understand the purpose of other video and audio APIs, including the Web Audio API, Media Stream Recording API, and Media Source Extensions API.

Resources:

3.2 Graphics/animation APIs

Learning outcomes:

  • Using timers and requestAnimationFrame() to set up animation loops:
    • Basic syntax and usage.
    • Understand why requestAnimationFrame() is an improvement over what came before it.
    • Common use cases for animation loops, for example, decorative animations and games.
  • Web Animations API:
    • Basic syntax and usage.
    • Understand how the Web Animations API relates to CSS animation properties, and when should you use each one.
    • Common use cases.
  • Canvas:
    • Understand conceptually what the <canvas> element and associated APIs enable.
    • Basic syntax and usage of the 2D Canvas API.
    • Looping <canvas> updates to create a simple animation or game.

Resources:

3.3 Client-side storage

Notes :

  • The main items of importance to understand in this set of conformance criteria are the general concepts, using Web Storage for simple client-side storage tasks, and how cookies are used in positive and negative ways.

Learning outcomes:

  • Understand the concepts of client-side storage:
    • Know the common client-side data storage mechanisms ? Web Storage API, cookies, Cache API, and the IndexedDB API.
    • Key use cases ? maintaining state across reloads, persisting login and user personalization data, and local/offline working.
    • Understand the negative patterns associated with client-side storage ? for example using cookies for tracking/fingerprinting.
  • Using cookies to store arbitrary data, normally controlled by HTTP headers.
  • Using Web Storage for simple key-value pair storage, controlled by JavaScript.
  • Using IndexedDB:
    • Complete client-side transactional database system.
    • Complex, and rarely used directly. You'd be more likely to use a library such as dexie.js .
  • Using Cache/Service Workers:
    • Understand the basic ideas behind their usage in Progressive Web Apps (PWAs), and the fundamental use case of making a site work offline.

Notes :

  • IndexedDB and the Cache API (commonly used with Service Workers) are complex, and constitute huge topics. Exhaustively understanding them at this stage is not necessary, although we would suggest that you gain an understanding of the basics behind how they work.

Resources:

Previous: 2. Custom JS objects Next: 4. Performance
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본