All Projects → anteriovieira → Vue Youtube

anteriovieira / Vue Youtube

Licence: mit
A simple component for a powerful API. vue-youtube provides a simple layer for you to use your imagination while over the YouTube IFrame Player API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Youtube

youtube-ios-player-helper-swift
A full swift implementation of https://github.com/youtube/youtube-ios-player-helper. Helper library for iOS developers looking to add YouTube video playback in their applications via the iframe player in a UIWebView
Stars: ✭ 55 (-78.93%)
Mutual labels:  player, youtube
Plyr React
A simple, accessible and customisable react media player for Video, Audio, YouTube and Vimeo
Stars: ✭ 89 (-65.9%)
Mutual labels:  player, youtube
Kaku
🎧 Kaku is a highly integrated music player supports different online platform like YouTube, SoundCloud, Vimeo and more. Available on Mac, Windows and Linux.
Stars: ✭ 1,028 (+293.87%)
Mutual labels:  player, youtube
Yt Player
Simple, robust, blazing-fast YouTube Player API
Stars: ✭ 576 (+120.69%)
Mutual labels:  player, youtube
Min Vid
Popout video player in Firefox
Stars: ✭ 180 (-31.03%)
Mutual labels:  player, youtube
Plyr
Plyr Mediaplayer (Video und Audio) im Front- und Backend
Stars: ✭ 30 (-88.51%)
Mutual labels:  player, youtube
Musicalyoutube
A Youtube floating PIP player for Android.
Stars: ✭ 50 (-80.84%)
Mutual labels:  player, youtube
Redditmusicplayer
🎵 A free and open-source streaming music web player using data from Reddit
Stars: ✭ 401 (+53.64%)
Mutual labels:  player, youtube
Shuffle
Shuffle every song in existence from YouTube
Stars: ✭ 131 (-49.81%)
Mutual labels:  player, youtube
Vime
Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
Stars: ✭ 1,928 (+638.7%)
Mutual labels:  player, youtube
Pip Tool
PiP tool is a software to use the Picture in Picture mode on Windows. This feature allows you to watch content (video for example) in thumbnail format on the screen while continuing to use any other software on Windows.
Stars: ✭ 572 (+119.16%)
Mutual labels:  player, youtube
YoutubePlayer
Play and download YouTube videos. Extract audio from video. With minimalist beautiful gui.
Stars: ✭ 19 (-92.72%)
Mutual labels:  player, youtube
React Player
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
Stars: ✭ 5,931 (+2172.41%)
Mutual labels:  player, youtube
Youtube Html Js Audio Player
An audio player created with HTML Audio and Javascript 🚀
Stars: ✭ 39 (-85.06%)
Mutual labels:  player, youtube
Maia Yt
Currently codenamed maia-yt is a userscript (and browser extension) that enhances the user's experience on YouTube.
Stars: ✭ 493 (+88.89%)
Mutual labels:  player, youtube
Youtube Extension
🔴YouTube Extension🧰>80 Features ⭐Please document, code or donate📌Tidy📌Longest-standing(2012)(Users>350000)⋮🎞️🎛️🎧⚙️🎬🔊☕🎨🧩🧪📈⏯️(Player: Repeat Screenshot Rotate; Hide related video distraction. Always expand video Description. Playback speed. Video Quality bandwidth H.264 electricity. Player Size Full Window. Themes Customization. Statistics. Reverse Playlist YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube Youtube enhancer YouTube app YouTube video YouTube YouTube YouTube api v3 YouTube playback YouTube player VP8 VP9 AV1 vidIQ tubebuddy download adblocker adblock ads sponsorblock addon youtube music ⭐ youtube premium css css4 html5 ytdl youtube-dl invidious iridium ParticleCore youtube+ youtube++ youtube-plus maia-yt youtube nonstop youtube control center vlogger vlog h264ify h264 m.youtube.com music.youtube.com studio.youtube youtube mobile youtube studio ⭐ kids Vanced gaming.youtube.com gaming youtubecenter freetube lite-youtube-embed newpipe youtube-dl-gui mps-youtube nuclear pytube awesome youtubers youtube downloader 8k 4k 60fps 30fps youtubeexplode vidgear k-lite tubebuddy adobe apple ios iphone design simplify ffmpeg premiere designer annoyance youtube upload
Stars: ✭ 1,027 (+293.49%)
Mutual labels:  player, youtube
Upnext
Chrome Extension for streaming music from SoundCloud & YouTube
Stars: ✭ 320 (+22.61%)
Mutual labels:  player, youtube
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+1442.53%)
Mutual labels:  player, youtube
Gsap Player
A small, customizable youtube-like player for gsap timelines
Stars: ✭ 92 (-64.75%)
Mutual labels:  player, youtube
Ytermplayer
Stream youtube playlists as audio on linux terminal
Stars: ✭ 235 (-9.96%)
Mutual labels:  player, youtube

vue-youtube

VueYoutube

npm vue2 Downloads License

Intro

vue-youtube is an wrapper of YouTube IFrame Player API (YIPA).

What is the difference between other plugins? The difference is that the function body is wrapped in a promise. This promise is resolved only when the player has finished loading and is ready to begin receiving API calls (onReady). Therefore, all function calls are queued and replayed only when player is ready.

You can do something like:

export default {
  // ...
  computed: {
    player() {
      return this.$refs.youtube.player
    }
  },
  methods: {
    async playVideo() {
      await this.player.playVideo()
      // Do something after the playVideo command
    }
  }
}

Live demo built on top of the awesome codesandbox.

Installation

npm install vue-youtube
# or
yarn add vue-youtube

Usage

Bundler (Webpack, Rollup)

import Vue from 'vue'
import VueYoutube from 'vue-youtube'

Vue.use(VueYoutube)

Browser

<!-- Include after Vue -->
<!-- Local files -->
<script src="vue-youtube/dist/vue-youtube.js"></script>

Example

<youtube :video-id="videoId" ref="youtube" @playing="playing"></youtube>
<button @click="playVideo">play</button>
export default {
  data() {
    return {
      videoId: 'lG0Ys-2d4MA'
    }
  },
  methods: {
    playVideo() {
      this.player.playVideo()
    },
    playing() {
      console.log('\o/ we are watching!!!')
    }
  },
  computed: {
    player() {
      return this.$refs.youtube.player
    }
  }
}

or

<youtube :video-id="videoId" :player-vars="playerVars" @playing="playing"></youtube>
export default {
  data() {
    return {
      videoId: 'lG0Ys-2d4MA',
      playerVars: {
        autoplay: 1
      }
    }
  },
  methods: {
    playing() {
      console.log('\o/ we are watching!!!')
    }
  }
}

Live demo

Events

The component triggers events to notify the parent component of changes in the player. For more information, see YouTube IFrame Player API.

Events => ready ended playing paused buffering cued error

Player

You have access to all api methods through component referencing.

Example:

<youtube video-id="lG0Ys-2d4MA" ref="youtube"></youtube>
export default {
  // ...
  methods: {
    playVideo() {
      this.$refs.youtube.player.playVideo()
    }
  }
}

Props

Prop Type(s) Default Description
width Number, String 640 iframe pixel width
height Number, String 360 iframe pixel height
resize Boolean false iframe will proportionally scale height with its width
resizeDelay Number 200 Delay in milliseconds before running resize callback
fitParent Boolean false iframe will use its parent's width
nocookie Boolean false Change host param to www.youtube-nocookie.com

Tips for Resizing

Resizing proportionally (resize) works best with a parent element. The parent element is used for a width reference. fitParent should be on in most situations. It allows resize to work without appyling CSS any properties to your iframe. If you want to turn fitParent off, you can emulate it with CSS by setting width to 100%, like so:

iframe {
  width: 100%;
  max-width: 650px; /* Also helpful. Optional. */
}

API

vm.$youtube.getIdFromUrl

New in v1.2.0

  • Type: Function
  • Description: Parse a youtube url returning the video ID. (get-youtube-id)
  • Arguments:
    • {String} url
    • {Object} options
  • Usage:
...
  methods: {
    getId () {
      return this.$youtube.getIdFromUrl(this.video.url)
    }
  }
...

or

import { getIdFromUrl } from 'vue-youtube'

const myFunction = (url) => {
  const youtubeId = getIdFromUrl(url)
  // ...
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].