npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-wistia-components

v0.0.2

Published

Wistia video upload and play components for AngularJS

Downloads

19

Readme

Wistia uploading and playing components for AngularJS

Angular components that allow you to upload and play videos via Wistia. There are separate components to upload a video, show upload progress, show error messages and play an uploaded video. The multi-components architecture will support whatever fancy structure you are building.

Uploading works via blueimp-file-upload.

Get Started

Install via npm:

npm install ng-wistia-components

Usage

Every implementation begins with a parent component ng-wistia. Then, to customize your experience, you can choose among other child components: ng-wistia-input, ng-wistia-progress, ng-wistia-error, ng-wistia-video.

Upload Video

To upload videos to Wistia, simply use the following setup:

<ng-wistia api-password="************">
  <p>Choose a video.</p>

  <!-- action button for selecting a video to upload -->
  <ng-wistia-input></ng-wistia-input>

  <!-- any error messages from wistia's API Will be shown below -->
  <ng-wistia-error></ng-wistia-error>
</ng-wistia>

Upload and Play Video

The below implementation will do everything as the above, and also play the video that you just uploaded:

<ng-wistia api-password="************">
  <p>Choose a video.</p>

  <!-- action button for selecting a video to upload -->
  <ng-wistia-input></ng-wistia-input>

  <!-- any error messages from wistia's API Will be shown below -->
  <ng-wistia-error></ng-wistia-error>

  <!-- uploaded video will play automatically -->
  <ng-wistia-video></ng-wistia-video>
</ng-wistia>

Upload, show upload progress, and Play Video

The below implementation will do everything as the above, and also show the a progress bar indicating the upload progress:

<ng-wistia api-password="************">
  <p>Choose a video.</p>

  <!-- action button for selecting a video to upload -->
  <ng-wistia-input></ng-wistia-input>

  <!-- any error messages from wistia's API Will be shown below -->
  <ng-wistia-error></ng-wistia-error>

  <!-- upload progress -->
  <ng-wistia-progress></ng-wistia-progress>

  <!-- uploaded video will play automatically -->
  <ng-wistia-video></ng-wistia-video>
</ng-wistia>

Custom Implementation of Upload and Play

The below implementation will prompt the user to upload a video, and once uploaded, will change the UI to show a player. This is achieved via ng-wistia-video's on-play attribute:

<ng-wistia api-password="************">
  <div ng-if="!videoPlaying">
    <h1>Upload a Video</h1>
    <p>Choose a video that you wish to upload to Wistia. The upload will begin automatically.</p>
    <ng-wistia-input></ng-wistia-input>
    <ng-wistia-error></ng-wistia-error>
    <ng-wistia-progress></ng-wistia-progress>
  </div>

  <div ng-if="videoPlaying">
    <h1>Playing your Video</h1>
    <p>Your uploaded video has been embedded below. The playback should start automatically.</p>
  </div>
  
  <!-- when video starts playing, we remove the upload, error, and progress components -->
  <ng-wistia-video on-play="videoPlaying = true"></ng-wistia-video>

</ng-wistia>

Independent Video Player

Using the video-id attribute of ng-wistia-video, any independent video can be played directly. Note that video-id is the hashed_id of a video on Wistia (e.g. 1iuyx2yvow):

<ng-wistia api-password="************">
  <ng-wistia-video style="width: 100%; height: 400px; display: block;" video-id="*****"></ng-wistia-video>
</ng-wistia>

Example Included

An example of a simple AngularJS app has been included. To run the example, follow these steps:

Step 1: Clone this repository

git clone https://github.com/ritenv/ng-wistia-components.git

Step 2: Navigate to the example directory

Step 3: Run with npm

npm start

Step 4: Add your Wistia API Password in example/home/view.html

<ng-wistia api-password="<Your Wistia API Password Here">

Step 5: Point your browser to http://localhost:8000

Testing

In order to test the components, simply install the devDependencies and run:

npm test

An HTML report of test cases will be generated at a new directory named karma_html.

Requirements