chromecasts

Query your local network for Chromecasts and have them play media

  • 所有者: mafintosh/chromecasts
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

chromecasts

Query your local network for Chromecasts and have them play media

npm install chromecasts

Usage

var chromecasts = require('chromecasts')()

chromecasts.on('update', function (player) {
  console.log('all players: ', chromecasts.players)
  player.play('http://example.com/my-video.mp4', {title: 'my video', type: 'video/mp4'})
})

API

var list = chromecasts()

Creates a chromecast list.
When creating a new list it will call list.update() once.
It is up to you to call afterwards incase you want to update the list.

list.update()

Updates the player list by querying the local network for chromecast instances.

list.on('update', player)

Emitted when a new player is found on the local network

player.play(url, [opts], cb)

Make the player play a url. Options include:

{
  title: 'My movie',
  type: 'video/mp4',
  seek: seconds, // start by seeking to this offset
  subtitles: ['http://example.com/sub.vtt'], // subtitle track 1,
  autoSubtitles: true // enable first track if you provide subs
}

player.subtitles(track, [cb])

Enable subtitle track. Use player.subtitles(false) to disable subtitles

player.pause([cb])

Make the player pause playback

player.resume([cb])

Resume playback

player.stop([cb])

Stop the playback

player.seek(seconds, [cb])

Seek the video

player.status(cb)

Get a status object of the current played video.

player.on('status', status)

Emitted when a status object is received.

License

MIT

主要指标

概览
名称与所有者mafintosh/chromecasts
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2015-04-12 06:04:00
推送于2021-10-04 14:15:31
最后一次提交2021-10-04 16:15:21
发布数19
最新版本名称v1.9.1 (发布于 2017-10-17 23:51:08)
第一版名称v1.0.0 (发布于 2015-04-11 23:04:07)
用户参与
星数1.5k
关注者数34
派生数68
提交数77
已启用问题?
问题数17
打开的问题数10
拉请求数16
打开的拉请求数4
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?