1.5.17 • Published 1 month ago

v3d-player v1.5.17

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

v3d-player

Html5 Video Player: vue3 + typescript + dplayer-lite

Dplayer Docs

Supports

  • Streaming formats

  • Media formats

    • AVC(H.264)
    • HEVC(H.265)
    • AAC
    • MP3

Installation

npm i v3d-player

or

npm i v3d-player mpegts.js hls.js

Usage

This is a vue 3.x component that can only be used in vue 3.x

ES Modules

Install v3d-player via npm and import the plugin as you would any other module. You will also need to import the stylesheet in some way.

<template>
  <div class="demo-player">
    <v3d-player
      ref="playerRef"
      :options="options"
    />
  </div>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import V3dPlayer from 'v3d-player'
import 'v3d-player/dist/style.css'

const options = reactive({
  autoplay: true,
  muted: true,
  screenshot: true,
  preventClickToggle: true,
  theme: '#FF3366',
  volume: 0.9,
  src: '//d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear3/prog_index.m3u8'
})
</script>

</script>
<style>
.demo-player {
  margin: 0 auto;
  margin-top: 50px;
  width: 640px;
  height: 480px;
}
</style>

Methods

pause()

pause video

play()

play video

close()

close video

seek(time: number)

seek to specified time

snapshot()

video capture. format: .png

speed(rate: number)

set video speed

toggle()

toggle between play and pause

volume(percentage: number, nonotice: boolean)

get video volume

  let value = playerRef.value?.volume()

set video volume

  playerRef.value?.volume(0.5, true)

Events

Example

<v3d-player
  @canplay="handleCanPlay"
  @loadstart="handleLoadStart"
/>

const handleCanPlay = () => {
  // console.log('canplay')
}

const handleLoadStart = () => {
  // console.log('loadstart')
}

Event List

  • Video events

    • abort
    • canplay
    • canplaythrough
    • durationchange
    • emptied
    • ended
    • error
    • loadeddata
    • loadedmetadata
    • loadstart
    • mozaudioavailable
    • pause
    • play
    • playing
    • progress
    • ratechange
    • seeked
    • seeking
    • stalled
    • suspend
    • timeupdate
    • volumechange
    • waiting
  • Player events

    • screenshot
    • contextmenu_show
    • contextmenu_hide
    • notice_show
    • notice_hide
    • quality_start
    • quality_end
    • destroy
    • resize
    • fullscreen
    • fullscreen_cancel
    • webfullscreen
    • webfullscreen_cancel
  • 事件流触发的顺序:

  1. onloadstart
  2. ondurationchange
  3. onloadedmetadata
  4. onloadeddata
  5. onprogress
  6. oncanplay
  7. oncanplaythrough

Project

setup

npm i

dev

npm run dev

build

npm run build
1.5.17

1 month ago

1.5.16

3 months ago

1.5.15

4 months ago

1.5.9

6 months ago

1.5.8

6 months ago

1.5.7

6 months ago

1.5.6

6 months ago

1.5.5

6 months ago

1.5.4

6 months ago

1.5.10

6 months ago

1.5.12

6 months ago

1.5.11

6 months ago

1.5.13

6 months ago

1.4.0

11 months ago

1.3.10

11 months ago

1.3.13

11 months ago

1.3.11

11 months ago

1.3.12

11 months ago

1.3.9

11 months ago

1.3.8

11 months ago

1.3.7

11 months ago

1.3.6

11 months ago

1.5.3

8 months ago

1.3.5

11 months ago

1.5.2

9 months ago

1.3.4

11 months ago

1.5.1

10 months ago

1.3.3

11 months ago

1.5.0

10 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.0

12 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.2.8

12 months ago

1.2.7

12 months ago

1.2.6

12 months ago

1.2.5

12 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.0.21

1 year ago

1.0.20

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.2

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.13

1 year ago

1.0.12

2 years ago

1.0.3-beta3

2 years ago

1.0.3-beta1

2 years ago

1.0.3-beta

2 years ago

1.0.2

2 years ago

1.0.2-beta1

2 years ago

1.0.2-beta

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago