Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: cannot read property mediaSessionId of null #23

Closed
roccomuso opened this issue Jul 24, 2016 · 2 comments
Closed

TypeError: cannot read property mediaSessionId of null #23

roccomuso opened this issue Jul 24, 2016 · 2 comments

Comments

@roccomuso
Copy link

Running this code:

var chromecasts = require('chromecasts')()

var file_url = 'http://......';

chromecasts.on('update', function (player) {
  console.log('all players: ', chromecasts.players)
  player.play(file_url, {title: 'my video', type: 'video/mp4'})
  // pause if after 5 seconds.
  setTimeout(function(){player.pause();}, 5000);
})

Raises a TypeError:

/node_modules/castv2-client/lib/controllers/media.js:88
  data.mediaSessionId = this.currentSession.mediaSessionId;
                                           ^

TypeError: Cannot read property 'mediaSessionId' of null

@Ivshti
Copy link
Collaborator

Ivshti commented Jul 24, 2016

This happens when the chromecast socket times out, I've dug deep into this:
thibauts/node-castv2-client#44

@Ivshti
Copy link
Collaborator

Ivshti commented Jul 24, 2016

I think the best approach is to close this issue and move the discussion to node-castv2-client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants