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

hozi-player-api

v1.8.6

Published

This project containes the API for hozi player, in order for other websites to integrate with it. It allow selecting video, controlling it's playack (play/pause), seeking, etc.

Downloads

19

Readme

Hozi Player API

Description

This project containes the API for hozi player, in order for other websites to integrate with it. It allow selecting video, controlling it's playack (play/pause), seeking, etc.

Implementations Details

The API based on the window.postMessage API, using post-robot library. The player is listening to certain commands via the Post-Robot library and reacts. This library is bundeld using webpack.

Installation

npm install hozi-player-api

Getting started

Add component with Iframe template. You can read more about Iframe src options here - https://gitlab.com/hozi/hozi-player-ui

    import { HoziPlayer, HoziPlayerApi } from 'hozi-player-api';

    @Component({
        selector: 'getting-started,
        template: `<iframe allowfullscreen="true" frameborder="0" scrolling="no" width="500px" height="368px" 
          src="https://hozi-player-ui.web.app/embd"></iframe>`
    })

    class GettingStartedComponent implements OnInit {

      private player: HoziPlayer;

      constructor() { }

      ngOnInit() {
        const iframe: HTMLIFrameElement = document.getElementsByTagName("iframe").item(0) as HTMLIFrameElement;

        this.player = new HoziPlayerApi(
          iframe,
          {
            timeout: 20000,
            events: {
              onReady: () => console.log("iframe loaded!", "close"),
              onVideoLoaded: (videoId: string) => console.log("Video loaded! - " + videoId, "close")
            }
          }
        )
      }

      play() {
        this.player.playVideo();
      }

      stop() {
        this.player.stopVideo();
      }

      async reverse() {  
        await this.player.reverse();
      }

      loadVideo(selectedId: string) {
        if (selectedId) {
          this.player.loadVideoById(selectedId);
        }
      }

      async seek(seconds: number) {  
        await this.player.seekVideo(seconds);
      }
  }

Api

Controlling Player

  • playVideo()
  • stopVideo()
  • reverse()
  • seekVideo(seconds: number)

Loading video

  • loadVideoById(videoId: string)