Coder Social home page Coder Social logo

chromecast-player's Introduction

chromecast-player

A simple chromecast player. Relies on the castv2-client lib from thibauts, all credits go to him.

Usage Samples

Start Playback of some video file:

const player = require('chromecast-player')();
const media = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/ED_1280.mp4';

player.launch(media, (err, p) => {
  p.once('playing', () => {
    console.log('playback has started.');
  });
});

Attach to a currently playing session:

const player = require('chromecast-player')();

player.attach((err, p) => {
  p.pause();
});

Installation

npm install chromecast-player --save

License

Copyright (c) 2014 Simon Kusterer Licensed under the MIT license.

chromecast-player's People

Contributors

amilajack avatar hemanth avatar jsteunou avatar oliverpool avatar parshap avatar xat avatar

Stargazers

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

Watchers

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

chromecast-player's Issues

Question: How to access metadata?

Previous versions of this api (0.0.6) allowed directly access to the metadata property on node-castv2-client. Is it still possible to do this?

Multiple Chromecasts

I'm trying to decipher where I could specify the name of a local chromecast so I could attach and send commands to that chromecast only. Any advice?

youtube example plugin

The new chromecast-player version I'm working on will have a simple plugin api (see the dev branch). there for I wanted to create a sample youtube plugin.

I managed to attach the player to an already running youtube session which I started from the browser. I was able todo stuff like play() or pause().

However, I was not able to start the playback of a youtube video. What I found out so far is, that the youtube appId is 233637DE, the contentId seems to be the youtube-id (e.g. aT5VZBeMz_g) and the contentType is x-youtube/video. When trying to load, the Chromecast device returns INVALID_PLAYER_STATE as error.

@thibauts do you have any thoughts on this?

handle close-events correctly

  • The onClose callback defined in api.js never seems to get called
  • There should be a defined way to shutdown the player
  • The listeners within timelineHelper.js should get removed on close

getVolume returns null

Very nice project ;) I only have a problem with getVolume, the callback gets null instead of the volume, what am I doing wrong?

var player = require('chromecast-player')();
player.attach(function (err, p) {
    p.getVolume(function (vol) {
        console.log(vol);
    });
});

Mute state isn't reflected in current session.

When querying the state of the Chromecast using getCurrentSession, the 2nd parameter on the callback says that the chromecast is not muted. Even after muting it with this lib.

I'm using v0.2.3 with a 1st generation Chromecast.

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.