GithubHelp home page GithubHelp logo

imgix / ix-video Goto Github PK

View Code? Open in Web Editor NEW
4.0 8.0 1.0 8.07 MB

An imgix video custom element that works anywhere

Home Page: https://imgix.github.io/ix-video/

License: BSD 3-Clause "New" or "Revised" License

JavaScript 8.51% TypeScript 78.39% CSS 0.06% HTML 13.04%
imgix video

ix-video's Introduction

imgix logo

⚠️ Note

This package has moved to the imgix/ix-elements/packages/ix-video repository. For updates, issues, and bug reports please see ix-elements.

The README and Documentation here reference @imgix/ix-video versions up to 1.x.

ix-video is an imgix video custom element that works anywhere.

npm version circleci Downloads License


Requirements

  • Node v12+

  • Browsers with Custom Elements V1 and Shadow DOM support, e.g. Chrome, Firefox, Safari, Edge (79+)

Browsers without native custom element support require a polyfill.

For Node/browser versions without es6 module support, you'll need to use a bundler like webpack or parcel to bundle the custom element.

Installation

Install this package in your project:

npm i @imgix/ix-video

Or add it from a CDN:

<script
  type="module"
  src="https://static.imgix.net/ix-video/@latest-v1/umd/ix-video.min.js"
></script>

Usage

For advanced usage instructions, customizations, and more, please see this project's complete documentation site.

These docs also host examples of how to use this component inside your React, Vue, or other web apps.

Using <ix-video> on a static HTML static page

Below is an example of how to import and use the ix-video custom element from a direct import or CDN on a static HTML page.

<html lang="en">
  <head>
    <title>ix-video in a static HTML file</title>
    <!-- Note: type 'module' here is important -->
    <script type="module">
      import {IxVideo} from './node_modules/@imgix/ix-video/dist/index.bundled.js';
    </script>
    <!-- Alternatively, the component can be loaded via a CDN -->
    <script type="module" src="https://static.imgix.net/ix-video/@latest-v1/umd/ix-video.min.js"></script>
  </head>
  <body>
    <h1>There is no bundler or bundling involved!</h1>
    <ix-video
      controls
      source="https://assets.imgix.video/videos/girl-reading-book-in-library.mp4"
    >
  </body>
</html>

Attributes

source: string, required

The video's source URL. Should be used in combination with type attribute when the source is not an HLS source.

type: string, optional (defaults to 'application/x-mpegURL')

The media type of the video. Supports standard video media types and HLS media types.

data-setup: string, optional (defaults to '{}')

Sets Video.js specific options. See video.js documentation for examples.

fixed: boolean, optional (defaults to false)

Will force the player to be a fixed size. This is useful if you want to use the player in a layout that has a fixed dimension. Without the fixed attribute, the player will be responsive to the size of the container it is placed in.

controls: boolean, optional (defaults to false)

Show/hide the player controls.

width: string, optional

The width of the video player. When fixed is set to true, the player will not automatically resize to fit inside the container's dimensions.

height: string, optional

Sets the video player's height. If fixed is set to true, the player will not automatically resize to fit inside the container's dimensions.

poster: string, optional

The video's poster image URL. The poster attribute will automatically try to resize the poster image to fit the video player's dimensions, assuming the attribute is given an imgix image URL.

ix-video's People

Contributors

atlawrie avatar luqven avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gmp

ix-video's Issues

feat: support next.js

Before you submit:

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of how this feature would function.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

BREAKING CHANGE: ix-video v 2.0

v2.0 will be a breaking change for this package.

Breaking changes for v 2.0

We've decided to go back to the drawing board and remove VideoJs as the engine for playback. Instead, we'll split the player's core and the player itself into two packages.

For 2.0, these packages will be moving to the imgix/ix-elements repository.

Why are we making this change?

From the start, we wanted to create a package that could be used in any modern web framework with little to no additional for the developer. This is why we chose to make <ix-video /> a web component.

We discovered that our developers really care about SSR/SSG and having a pre-wrapped React variant. We'd have needed to make significant changes to our codebase to deliver on these needs. Lit's lack of SSR support was a significant blocker for a long time. VideoJS as well has no out-of-the-box support for SRR/SSG. Despite several mitigations for this, we felt strongly that an SSR/SSG-first approach was needed.

So we looked around for who was doing this best in the custom-elements space for video. We liked what the folks at mux were doing with mux-player. However, their player was designed with mux APIs in mind and wasn't compatible with imgix out-of-the-box.

Where ix-video is headed

Thankfully, the team at mux open-sourced mux-elements. By forking that repository, we were able to create a player and player core that fulfills our and our developer's biggest priorities:

  • Easy to use
  • SSR-first
  • Cross-framework compatible
  • Fast

Moreover, future updates to our player are not reliant on Lit or any framework's ability to support the features we need. We can make changes as quickly as our developers need them.

A note to ix-video 1.X users

We'll continue to ship security updates to ix-video v1.X for the next few months to give folks time to transition to 2.0's breaking changes.

A special thanks go out to all the users who took the time to open issues and give us feedback throughout development. Your insights directly guided the development and direction of ix-video 2.0.

If you have any comments or questions, please do comment on this issue, and we'll be sure to reply as we can.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

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.