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

luo-vue-aliplayer

v1.0.18

Published

This is an extension of aliplayer

Downloads

2

Readme

Luo-Vue-AliPlayer

Vue 2.x Video Player Components and Classes Based on vue-aliplayer.

Install

npm install luo-vue-aliplayer -S

Usage

import { LuoVueAliplayerDom, AliPlayerComponent } from 'luo-vue-aliplayer';

export default {
  components: {
    'ali-player': LuoVueAliplayerDom
  }
}

or:

import { LuoAliplayer } from 'luo-vue-aliplayer';

LuoAliplayer.then((player) => {
  new player({
    id: "id",
    source: "https://testvod.21tb.com/cdc9311751cb4860925cddafa33de03e/e489980b982d6cfff0e1b540aa2e1baf-ld-encrypt-stream.m3u8"
  });
});

Web Player Ali Document (属性和事件以及方法跟aliplayer一一对应)

Document

Props

| 名称 | 类型 | 默认值 | 说明 | | ---------- | ---- | ------- | ----------- | | disableProgressBar | String | | 1、left 禁止向左拖动进度条;2、right 禁止向右拖动进度条;3、all 禁止拖动进度条;| | bodyBackgroundColor | String | | 安卓播放后黑边问题,设置的背色 |

获取播放时最大进度

methods: { timeupdate (e) { console.log(e.maxProgress); }, }

setProps

<ali-player 
  id="id"
  source="https://testvod.21tb.com/cdc9311751cb4860925cddafa33de03e/e489980b982d6cfff0e1b540aa2e1baf-ld-encrypt-stream.m3u8"
  :useH5Prism="true"
  x5_type="h5"
  :isLive="is"
>
</ali-player>

export default {
  data () {
    return {
      is: false
    }
  }
}

Events

<ali-player @play="play"></ali-player>

export default {
  methods: {
    play() {
      console.log('play callback')
    }
  }
}

如何获取播放对象:


- 第一种方式

<ali-player @play="play" @ready="ready"></ali-player>

export default {
  methods: {
    play (e) {
      console.log(e);
    },
    ready (e) {
      console.log(e);
    }
  }
}

- 第二种方式

<ali-player ref="player" @ready="ready"></ali-player>

export default {
  methods: {
    ready () {
      var player = this.$refs.player.instance;
      console.log(player);
    }
  }
}

- 第三种方式

<ali-player></ali-player>

import { LuoAliplayer } from 'luo-vue-aliplayer';
export default {
  mouted () {
    LuoAliplayer.then((e) => {
      console.log(e);
    });
  }
}

- 第四种方式

<ali-player @play="play($event, 1)"></ali-player>

export default {
  methods: {
    play (e, param) {
      console.log(e);
    }
  }
}

如何调用方法:

- 第一种方式

<ali-player @play="play"></ali-player>

export default {
    methods: {
      play(e) {
        let time = e.getCurrentTime();
        console.log(time);
      }
    }
}

- 第二种方式

<ali-player ref="player" @ready="ready"></ali-player>

export default {
  methods: {
    ready () {
      let play = this.$refs.player.instance;
      let time = play.getCurrentTime();
      console.log(time);
    }
  }
}

- 第三种方式

import { LuoAliplayer } from 'luo-vue-aliplayer';

export default {
  created () {
    LuoAliplayer.then((player) => {
      let play = new player({
                  id: "id",
                  source: "https://testvod.21tb.com/cdc9311751cb4860925cddafa33de03e/e489980b982d6cfff0e1b540aa2e1baf-ld-encrypt-stream.m3u8"
                });
      let time = play.getCurrentTime();
      console.log(time);
    });
  }
}

事件如何传参:


- 第一种方式

<ali-player @play="play(1)"></ali-player>

export default {
    methods: {
      play(param) {
        console.log(param);
      }
    }
}

- 第二种方式

<ali-player @play="play($event, 1)"></ali-player>

export default {
    methods: {
      play(e, param) {
        let time = e.getCurrentTime();
        console.log(time);
        console.log(param);
      }
    }
}

License

This content is released under the MIT License.