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

aframe-video-controls

v0.3.0

Published

Video Controls for video assets

Downloads

44

Readme

aframe-video-controls

A video control component for A-Frame. Demo [here] (https://oscarmarinmiro.github.io/aframe-video-controls)

It attaches to a video asset so you can play/pause the video (assuing it is projected on a plane or sphere) by looking and clicking on the 'play' icon or transport bar.

You can also press the 'space bar' or the arrow keys to control the video if you are in a 'desktop' computer

"The component in action"

Feedback is needed and very welcome, specially regarding User Experience!!!

I'm working on the following features, but feel free to suggest via Github Issues:

  • 'Flat' component if on Desktop (i.e: not in the 3D space)
  • Test on iPhone and Vive (at the moment I tested this in Android, Cardboard and Oculus Rift DK2)
  • Test on much bigger files
  • Volume controls
  • Another control to jump between different files so you can 'browse' different videos
  • 'Auto hide feature': If x seconds have passed after last interaction with player, hide the controls and A-Frame cursor

Demo

You can play with a live demo [here] (https://oscarmarinmiro.github.io/aframe-video-controls)

Properties

| Property | Description | Default Value | | -------- | ----------- | ------------- | | src | selector of the video asset | mandatory | | size | horizontal size of the player in meters | 1.0 | | distance | distance of the player from the camera in meters | 2.0 | | backgroundColor | Color of the player background. | black | | barColor | Color of the video progress bar. | red | | textColor | Color of the text. | yellow | | infoTextBottom | Bottom text to display under the bar to explain how to use it. | Double-click outside player... | | infoTextTop | Top text to display under the bar to explain how to use it. | Look+click on play... | | infoTextFont | Font for info text. | 35px Helvetica Neue | | statusTextFont | Font for text to right of player. | 30px Helvetica Neue | | timeTextFont | Font for time progress. | 70px Helvetica Neue |

Usage

Just include the component and put your video into the A-frame assets section.

Then just include an entity with the 'src' attribute 'pointing' to the video asset you want to control.

You can supply your own 'play' and 'pause' images for the player by including these lines into the assets of your scene:

    <a-assets>
        <img id="video-play-image" src="img/play.png">
        <img id="video-pause-image" src="img/pause.png">
     ...

Otherwise, the default 'play' and 'pause' images (CDN-hosted) will be used.

Browser Installation

Install and use by directly including the browser files:

This example projects a 360 video into a videosphere and attaches the controls to it.


<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.2.0/aframe.min.js"></script>
  <script src="https://rawgit.com/oscarmarinmiro/aframe-video-controls/master/dist/aframe-video-controls.min.js"></script>
</head>

 <body>
    <a-scene>
      <a-assets>
        <video id="video_1" src="https://ucarecdn.com/bcece0a8-86ce-460e-856b-40dac4875f15/"></video>
      </a-assets>

      <a-camera position="0 0 5">
          <a-cursor id="cursor" color="yellow"></a-cursor>
      </a-camera>

      <a-videosphere src="#video_1" rotation="0 180 0"></a-videosphere>

      <a-entity video-controls="src:#video_1"></a-entity>

    </a-scene>
  </body>

NPM Installation

Install via NPM:

npm install aframe-video-controls

Then register and use.

require('aframe');
require('aframe-video-controls');