1.0.0 • Published 7 years ago

vue-media-embed v1.0.0

Weekly downloads
297
License
ISC
Repository
github
Last release
7 years ago

vue media embed Embed for YouTube, Vimeo and SoundCloud This plugin requires Vuex

Features

  • Auto pause players
  • Restore previous state from store

Installation

npm install vue-media-embed

Usage

import Vue from 'vue'
import VueMediaEmbed from 'vue-media-embed'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({ ... })

Vue.use(VueMediaEmbed, { store })

Example

In this example we embed 3 players

<vue-media-embed source="soundcloud://295067272" :auto-play="1" :allow-fullscreen="0" />
<vue-media-embed source="youtube://C6vinrXWxls" :auto-play="0" :allow-fullscreen="1" />
<vue-media-embed source="vimeo://70114668" :auto-play="0" :allow-fullscreen="0" />

sources like http://vimeo.com/190613094 and https://www.youtube.com/watch?.. or https://youtu.be/{ID} are fine too

Overall props

PropertyDescriptionDefaultExample
sourcePlatform and ID of the mediarequiredvimeo://70114668
auto-playStart playing automatically when player is loaded01
auto-pausePause player when another player starts playing10
relatedShow related content01

SoundCloud

see docs

PropertyDescriptionDefaultOptions
show-buyingShow/hide buy buttons01
show-likingShow/hide like buttons01
show-downloadShow/hide download buttons01
show-sharingShow/hide share buttons/dialogues01
show-artworkShow/hide artwork01
show-commentsShow/hide comments01
show-play-countShow/hide number of sound plays01
show-userShow/hide the uploader name01
start-trackPreselects a track in the playlist, given a number between 0 and the length of the playlist.0positive integer

Vimeo

see docs

PropertyDescriptionDefaultOptions
show-badgeenable or disable badge on the video01
bylineShow the user’s byline on the video01
colorSpecify the color of the video controls. Defaults to 00adef. Make sure that you don’t include the #.00adef
loopPlay the video again when it reaches the end01
show-portraitShow the user’s portrait on the video01
show-titleShow the title on the video01

YouTube

see docs

PropertyDescriptionDefaultOptions
colorColor theme'red''white'
controlsvideo player controls10 2
disable-keyboardKeyboard controls01
startStarts playing video in seconds-1p ositive integer
endStop playing video from start in seconds-1positive integer
allow-fullscreenDisplays fullscreen button10
localeSets the player's interface language'''fr', 'fr-ca',..
annotations1 causes video annotations to be shown by default, whereas setting to 3 causes video annotations to not be shown by default.31, 2
loopLoop a video01
modest-brandingMinimize YouTube logo10
plays-inlineplays video inline for iOS.01
show-infoDisplays information01

Issues and features requests

Any issues or would love to see another embed being supported? Add a feature request