Giter Club home page Giter Club logo

openplayerjs-youtube's Introduction

openplayer

JSDelivr

Now you can play any YouTube videos using the awesome OpenPlayerJS!

๐Ÿšจ IMPORTANT ๐Ÿšจ

๐Ÿ”ง This repository is in maintenance at this point. ๐Ÿ”ง

No new features or additions will be added, only bug fixes.

Installation

  1. Set the video/audio as indicated in the OpenPlayerJS installation.
  2. Set the type of your source as video/x-youtube.
  3. Load this package library right after OpenPlayerJS.
  4. And voilรก!

Configuration

It allows you to override YouTube's configuration by using the youtube object in the settings. Check Supported parameters section for more details.

Example

<!DOCTYPE html>
<html lang="en">
  <body>
    <video class="op-player__media" id="video" controls playsinline>
      <source
        src="https://www.youtube.com/watch?v=xcJtL7QggTI"
        type="video/x-youtube"
      />
    </video>
    <script src="https://cdn.jsdelivr.net/npm/openplayerjs@latest/dist/openplayer.min.js"></script>
    <script src="/path/to/openplayerjs-youtube.min.js"></script>
    <script>
      var player = new OpenPlayer("video", {
        youtube: {
          // config
        },
      });
      player.init();
    </script>
  </body>
</html>

A word about Privacy

This YouTube plug-in leverages the Google's YouTube Iframe API, which in turn will allow you to set a regular YouTube URL. However, this URL sets a tracking cookie by default (for marketing purposes).

This alone represents a compliance issue for the European General Data Protection Regulation (GDPR), and potentially for browsers with more strict privacy policies.

This plug-in has an option to disable the cookie in the settings, which in that case is recommended to use in this case: nocookie; however, this is only one of the multiple steps to achieve an experience that is according to what Privacy Policy expects.

To learn more about how to get a better experience with YouTube and GDPR, check this source.

openplayerjs-youtube's People

Contributors

dependabot[bot] avatar rafa8626 avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

frankfanslc

openplayerjs-youtube's Issues

use in react

Do you have any document or example for use in react?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.