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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?