Giter Site home page Giter Site logo

vue-twitch-player's Introduction

vue-twitch-player license

A Vue component for embedding a Twitch player. See component for all available properties.

Vue-plugin-load-script is a dependency, since the Twitch Player API needs to be included from Twitch's servers.

Install

# npm
npm install --save-dev vue-twitch-player
# yarn
yarn add --dev vue-twitch-player

Use

  // In main.js
  import LoadScript from 'vue-plugin-load-script';

  Vue.use(LoadScript);
<template>
  <twitch-player
    :channel="channel"
  ></twitch-player>
</template>

<script>
  import VueTwitchPlayer from 'vue-twitch-player';

  export default {
    // ...
    components: {
      VueTwitchPlayer,
    },
    data() {
      return {
        channel: 'tserkov',
      };
    },
    // ...
  };
</script>
<template>
  <twitch-player
    :video="video"
  ></twitch-player>
</template>

<script>
  import VueTwitchPlayer from 'vue-twitch-player';

  export default {
    // ...
    components: {
      VueTwitchPlayer,
    },
    data() {
      return {
        video: '117216248',
      };
    },
    // ...
  };
</script>
<template>
  <twitch-player
    :collection="collection"
  ></twitch-player>
</template>

<script>
  import VueTwitchPlayer from 'vue-twitch-player';

  export default {
    // ...
    components: {
      VueTwitchPlayer,
    },
    data() {
      return {
        collection: 'TbyX29kRqhRnxA',
      };
    },
    // ...
  };
</script>

vue-twitch-player's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-twitch-player's Issues

Emit child method

Hi! How to emit child method, for example, 'play' after listen method pause?

Parent:

<twitch-player :channel="url" @pause="onPaused()"></twitch-player>

    //...
    methods: {
        onPaused() {
            this.$emit('play'); //on child
        },
    //...

Adding comments

Hello, I would like to add the comments on the side of the video. I tested some settings without success. Apart from this detail everything works thank you very much !!

Failed to compile.

after installation vue-twitch-player, and complet "main.js" and "template" , I have error message : "Failed to compile.

./src/components/StreamPage.vue
Module Error (from ./node_modules/eslint-loader/index.js):

/var/www/html/o-game/O-game-frontend/app/src/components/StreamPage.vue
13:7 error The "VueTwitchPlayer" component has been registered but not used vue/no-unused-components

โœ– 1 problem (1 error, 0 warnings)"
I use Vue.Js version 4.4.6

thank you

Multiple TwitchVideos Element

Hi there,

first of all thank you for the great work and providing this as OS.

I try to include multiple TwitchVideos on one page but only one starts to load. All other components are there but twitch doesn't seem to populate it with the iframe.

Any ideas?

Best regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.