1.0.16 • Published 1 year ago

vodplayer v1.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

VODPlayer

VODPlayer is a Web Video player which built from HTML5 and other third party libraries.

Formats of video supported are mp4, flv, m3u8 and VR Video.

English | 简体中文

Install

npm install vodplayer

Params

Required
PropDescriptionDefault
videoSourceThe URL of Video file(mp4, flv, m3u8)
Optional
PropDescriptionDefault
autoplayPlayback automaticallyfalse
loopContinuous loop of video0
mutedmute0
controlShow the control panel1
coverpicThe URL of cover picutre
focusJsonHighlights of the video, e.g. '{"cutImage":"","title":"highlight1","startPoint":"121","endPoint":"185","id":52},{"cutImage":"","title":"highlight2","startPoint":"221","endPoint":"285","id":533}'
starttimePlayback at this time. (autoplay must be false)
endtimeStop video at this time. (autoplay must be false)
vrPanoramic Video is 10
threeJSPathThe URL of three.js. If vr is 1, required.
flvJSPathThe URL of flv.js. If videoSource is .flv, required.
hlsJSPathThe URL of hls.js. If videoSource is .m3u8, required.
requireJSPathThe URL of require.js. If needing to load three.js/flv.js/hls.js, required.

Usage

Vue.js

Player.vue

<template>
  <div id="id" ref="player"></div>
</template>

<script>
import { VODPlayer } from 'vodplayer'  

export default {
  name: 'Player',

  mounted() {
    new VODPlayer(this.$refs.player, {
      autoplay:false,
      videoSource: '//www.w3school.com.cn/i/movie.mp4'
    })
  }
}
</script>

<style scoped>
#id {
  height: 400px;
}
</style>

React

App.js

import React from 'react';
import { VODPlayer } from "vodplayer";

function App() {
  let playerRef = null;

  function init() {
    new VODPlayer(playerRef, {
      autoplay:false,
      videoSource:"//www.w3school.com.cn/i/movie.mp4"
    })
  }

  return (
    <div className="App">
      <div ref={p => {playerRef = p; init();}}></div>

      <style>{`
        .App {
          height: 400px;
        }
      `}</style>
    </div>
  );
}

export default App;

Contributing

VODPlayer is an open source project. I'm glad of any suggestions and bug report.

Acknowledgments

flv.js
hls.js
three.js

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago