All Projects → paypal → Accessible Html5 Video Player

paypal / Accessible Html5 Video Player

Licence: bsd-3-clause
Accessible HTML5 Video Player

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to Accessible Html5 Video Player

Ubkaccessibilitykit
An iOS framework to help with accessibility development and testing.
Stars: ✭ 170 (-92.87%)
Mutual labels:  accessibility
Vue Announcer
A simple way with Vue to announce any useful information for screen readers.
Stars: ✭ 185 (-92.24%)
Mutual labels:  accessibility
Chimee
a video player framework aims to bring wonderful experience on browser
Stars: ✭ 2,332 (-2.18%)
Mutual labels:  html5-video-player
Empathy Prompts
💡 Ideas to help consider Inclusive Design principles when making things for others to use.
Stars: ✭ 173 (-92.74%)
Mutual labels:  accessibility
Ej2 Vue Ui Components
Syncfusion Vue UI component library offer more than 50+ cross-browser, responsive, and lightweight vue UI controls for building modern web applications.
Stars: ✭ 182 (-92.37%)
Mutual labels:  accessibility
Bootstrap Vue
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
Stars: ✭ 13,603 (+470.6%)
Mutual labels:  accessibility
Expresscart
A fully functioning Node.js shopping cart with Stripe, PayPal, Authorize.net, PayWay, Blockonomics, Adyen, Zip and Instore payments.
Stars: ✭ 2,069 (-13.21%)
Mutual labels:  paypal
Fga
Auto-battle app for F/GO Android
Stars: ✭ 205 (-91.4%)
Mutual labels:  accessibility
Wwdc Notes
WWDCNotes.com content ✨
Stars: ✭ 183 (-92.32%)
Mutual labels:  accessibility
React Md
React material design - An accessible React component library built from the Material Design guidelines in Sass
Stars: ✭ 2,284 (-4.19%)
Mutual labels:  accessibility
Gtxilib
Google Toolbox for Accessibility for iOS
Stars: ✭ 177 (-92.58%)
Mutual labels:  accessibility
Lighthouse Check Action
GitHub Action for running @GoogleChromeLabs Lighthouse audits with all the bells and whistles 🔔 Multiple audits, Slack notifications, and more!
Stars: ✭ 175 (-92.66%)
Mutual labels:  accessibility
Capable
Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.
Stars: ✭ 189 (-92.07%)
Mutual labels:  accessibility
Sanderling
APIs and libraries to read information directly from the EVE Online game client.
Stars: ✭ 169 (-92.91%)
Mutual labels:  accessibility
Accessible modal window
Accessible modal dialogs
Stars: ✭ 196 (-91.78%)
Mutual labels:  accessibility
Focusoverlay
Library for creating animated overlays on focused elements
Stars: ✭ 167 (-92.99%)
Mutual labels:  accessibility
Griffith
A React-based web video player
Stars: ✭ 2,287 (-4.07%)
Mutual labels:  html5-video-player
Eslint Plugin Jsx A11y
Static AST checker for a11y rules on JSX elements.
Stars: ✭ 2,609 (+9.44%)
Mutual labels:  accessibility
Accessibility Insights Windows
Accessibility Insights for Windows
Stars: ✭ 202 (-91.53%)
Mutual labels:  accessibility
Accessibilityjs
Client side accessibility error scanner.
Stars: ✭ 2,190 (-8.14%)
Mutual labels:  accessibility

Accessible HTML5 Video Player

paypal javascript

What is it?

A lightweight HTML5 video player which includes support for captions and screen reader accessibility. For details, read the blog post Introducing an Accessible HTML5 Video Player on the PayPal Engineering blog (updated link). Also see 7 Lessons from Developing an Accessible HTML 5 Video Player.

Features

  • Provides an HTML5 video player with custom controls.
  • Supports captions; simply denote a VTT caption file using the standard HTML5 video syntax.
  • Uses native HTML5 form controls for volume (range input) and progress indication (progress element).
  • Accessible to keyboard-only users and screen reader users.
  • Option provided to set captions on or off by default (upon loading).
  • Option provided to set number of seconds by which to rewind and forward.
  • Text strings for the controls are externalized to allow for internationalization (fall 2015).
  • No dependencies. Written in "vanilla" JavaScript.
  • When JavaScript is unavailable, the browser's native controls are used.
  • React support

Implementation

CSS and Image

Insert the CSS in the Head of your HTML document. You'll also need to upload the sprite image (or use your own) and adjust the path in the CSS file.

<link rel="stylesheet" href="/css/px-video.css" />

HTML

Insert the HTML5 video markup in the Body of your HTML document. Replace the video, poster, and caption URLs. Modify the sizes of video and fallback image as needed.

<div class="px-video-container" id="myvid">
    <div class="px-video-img-captions-container">
        <div class="px-video-captions hide" aria-hidden="true"></div>
        <video width="640" height="360" poster="media/foo.jpg" controls>
            <source src="foo.mp4" type="video/mp4" />
            <source src="foo.webm" type="video/webm" />
            <track kind="captions" label="English captions" src="media/foo.vtt" srclang="en" default />
            <div>
                <a href="foo.mp4">
                    <img src="media/foo.jpg" width="640" height="360" alt="download video" />
                </a>
            </div>
        </video>
    </div>
    <div class="px-video-controls"></div>
</div>

JavaScript

Insert two JavaScript files right before the closing Body element of your HTML document. Add a Script element to initialize the video. Options are passed in JSON format. The options are:

option description dataType default
videoId the value of the ID of the widget container string required
captionsOnDefault denotes whether to show or hide caption upon loading boolean optional true
seekInterval the number of seconds to rewind and fast forward number optional 10
videoTitle short title of video; used for aria-label attribute on Play button to clarify to screen reader user what will be played string optional Play
debug turn console logs on or off boolean optional false
<script src="js/strings.js"></script>
<script src="js/px-video.js"></script>
<script>
// Initialize
new InitPxVideo({
    "videoId": "myvid",
    "captionsOnDefault": true,
    "seekInterval": 20,
    "videoTitle": "clips of stand-up comedy",
    "debug": true
});
</script>

View Demo

React Version

The React version has been designed to be integrated into your react codebase easily. The video React component is named PXvideo and has the below API:

<PXVideo
    sources={[
    'https://www.paypalobjects.com/webstatic/mktg/videos/PayPal_AustinSMB_baseline.mp4',
    'https://www.paypalobjects.com/webstatic/mktg/videos/PayPal_AustinSMB_baseline.webm'
  ]}
  caption={{
    label: 'English captions',
    source: 'media/captions_PayPal_Austin_en.vtt',
    lang: 'EN',
    default: true
  }}
  poster="media/poster_PayPal_Austin2.jpg"
  width="640"
  height="360"
  controls={true}
  id="myvid"
  fallback={true}
  seekInterval={20}
  debug={true}
/>

A demo could be reached at: View Demo

Development

npm install // install dependencies
npm run react // transpile .jsx into valid .js using Babel

Feedback and Contributions

If you experience any errors or if you have ideas for improvement, please feel free to open an issue or send a pull request.

You can also follow and contact the PayPal Accessibility team on Twitter: @PayPalInclusive No longer exists.

Authors/Maintainer

Browser Support

  • Chrome: full support.
  • Safari: full support.
  • Firefox: full support.
  • Internet Explorer 10, 11: full support.
  • Internet Explorer 9: native video player used (aesthetic choice since HTML5 range input and progress element are not supported).
  • Internet Explorer 8: renders fallback content of video element (in the demo, this is an image linked to the video file).
  • Smartphones and tablets: controls and captions are not customized as both are natively supported in latest versions.

Limitations and Known Issues

  • Currently, only one caption file per video is supported.
  • Only VTT caption files are supported (not SRT nor TTML). VTT cue settings are not supported but inline styles function (see first few lines of example).
  • The controls have a minimum width of 360px.

Related Resources

Projects influenced by the PayPal Accessible HTML5 Video Player

Copyright and License

Copyright 2019, PayPal under the BSD license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].