0.1.1 • Published 6 years ago

@ajmariduena/vvideo v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

vvideo

A simple Vue.js Video component

Demo Here

Installation

npm i @ajmariduena/vvideo --save-dev

Usage

<vvideo 
  source-webm="http://techslides.com/demos/sample-videos/small.webm"
  source-ogg="http://techslides.com/demos/sample-videos/small.ogv"
  source-mp4="http://techslides.com/demos/sample-videos/small.mp4"
  source-3gp="http://techslides.com/demos/sample-videos/small.3gp"
>
</vvideo>

Props

Prop nameDescriptionTypeRequiredDefault value
source-webmPath to webm srcStringno
source-oggPath to ogg srcStringno
source-mp4Path to mp4 srcStringno
source-3gpPath to 3gp srcStringno
play-buttonShow play buttonBooleannotrue
mute-buttonShow mute buttonBooleannotrue
progress-barShow progress barBooleannotrue
full-screen-buttonShow fullscreen buttonBooleannotrue
wrapper-classChange default wrapper classStringnovvideo_wrapper
video-classChange default video classStringnovvideo
toolbar-classChange default progress bar classStringnovvideo__toolbar
button-classChange default button classStringnovvideo__button
progress-bar-classChange default progress bar classStringnovvideo__progressbar

Events

Event nameDescriptionParameters
clickfire when hello text is clickedhelloText: String

Slots

Here you can customize vvideo buttons, it can be anything you want.

Slot nameDescriptionAccepted Element
playIconPlay button content slotany
pauseIconPause button content slotany
replayIconReplay button content slotany
muteIconMute button content slotany
muteOffIconUnmute button content slotany
fullScreenIconFullscreen button content slotany

Default styles

Default vvideo styles just for reference.

.vvideo_wrapper {
  width: 500px;
  height: 350px;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.11),
    0 5px 15px 0 rgba(0, 0, 0, 0.08);
}
.vvideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.vvideo__toolbar {
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  margin-bottom: 6px;
  position: absolute;
  bottom: 0;
  left: 0;
  align-items: center;
}
.vvideo__button {
  z-index: 2;
  width: 50px;
  height: 100%;
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  outline: 0;
  transition: transform 200ms ease-in-out;
}
.vvideo__button:hover {
  transform: scale(1.2);
}
.vvideo__progressbar {
  flex: 1;
  height: 10px;
  position: relative;
  background: #efefef;
  z-index: 2;
  border-radius: 5px;
  margin: 0 1rem;
  overflow: hidden;
}
.vvideo__progressbar > span {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: #3498db;
  transition: all 300ms linear;
}

Roadmap

  • Add click to play option

Contributing

See CONTRIBUTING.md for development guide.


This component was generated with vue-authoring-template using vue-cli.