electron-cast 0.4.0 → 0.5.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +280 -0
- package/CONTRIBUTING.md +305 -0
- package/README.md +211 -165
- package/SECURITY.md +324 -0
- package/dist/cjs/client/auth/build-time.js +1 -1
- package/dist/cjs/client/auth/cast-auth.d.ts +2 -0
- package/dist/cjs/client/auth/cast-auth.js.map +1 -1
- package/dist/cjs/dial/dial-registry.d.ts +104 -0
- package/dist/cjs/dial/dial-registry.js +301 -0
- package/dist/cjs/dial/dial-registry.js.map +1 -0
- package/dist/cjs/dial/dial-sink-service.d.ts +108 -0
- package/dist/cjs/dial/dial-sink-service.js +314 -0
- package/dist/cjs/dial/dial-sink-service.js.map +1 -0
- package/dist/cjs/dial/http.d.ts +40 -0
- package/dist/cjs/dial/http.js +172 -0
- package/dist/cjs/dial/http.js.map +1 -0
- package/dist/cjs/dial/index.d.ts +63 -0
- package/dist/cjs/dial/index.js +134 -0
- package/dist/cjs/dial/index.js.map +1 -0
- package/dist/cjs/dial/origins.d.ts +4 -0
- package/dist/cjs/dial/origins.js +36 -0
- package/dist/cjs/dial/origins.js.map +1 -0
- package/dist/cjs/dial/parse.d.ts +101 -0
- package/dist/cjs/dial/parse.js +296 -0
- package/dist/cjs/dial/parse.js.map +1 -0
- package/dist/cjs/dial/route-provider.d.ts +96 -0
- package/dist/cjs/dial/route-provider.js +376 -0
- package/dist/cjs/dial/route-provider.js.map +1 -0
- package/dist/cjs/dial/ssdp-socket.d.ts +34 -0
- package/dist/cjs/dial/ssdp-socket.js +72 -0
- package/dist/cjs/dial/ssdp-socket.js.map +1 -0
- package/dist/cjs/dial/xml.d.ts +13 -0
- package/dist/cjs/dial/xml.js +208 -0
- package/dist/cjs/dial/xml.js.map +1 -0
- package/dist/cjs/discovery/cast-discovery.d.ts +2 -0
- package/dist/cjs/discovery/cast-discovery.js.map +1 -1
- package/dist/cjs/discovery/device-cache.d.ts +9 -0
- package/dist/cjs/discovery/device-cache.js.map +1 -1
- package/dist/cjs/discovery/index.d.ts +1 -0
- package/dist/cjs/discovery/index.js +1 -0
- package/dist/cjs/discovery/index.js.map +1 -1
- package/dist/cjs/discovery/ip-policy.d.ts +20 -0
- package/dist/cjs/discovery/ip-policy.js +109 -0
- package/dist/cjs/discovery/ip-policy.js.map +1 -0
- package/dist/cjs/discovery/udp-socket.d.ts +3 -0
- package/dist/cjs/discovery/udp-socket.js +3 -0
- package/dist/cjs/discovery/udp-socket.js.map +1 -1
- package/dist/cjs/electron/access-code.d.ts +221 -0
- package/dist/cjs/electron/access-code.js +586 -0
- package/dist/cjs/electron/access-code.js.map +1 -0
- package/dist/cjs/electron/app-discovery.d.ts +82 -0
- package/dist/cjs/electron/app-discovery.js +219 -0
- package/dist/cjs/electron/app-discovery.js.map +1 -0
- package/dist/cjs/electron/default-presentation.d.ts +38 -0
- package/dist/cjs/electron/default-presentation.js +88 -0
- package/dist/cjs/electron/default-presentation.js.map +1 -0
- package/dist/cjs/electron/main.d.ts +98 -11
- package/dist/cjs/electron/main.js +602 -20
- package/dist/cjs/electron/main.js.map +1 -1
- package/dist/cjs/electron/manager-api.d.ts +200 -18
- package/dist/cjs/electron/manager-api.js +199 -4
- package/dist/cjs/electron/manager-api.js.map +1 -1
- package/dist/cjs/electron/media-controller.d.ts +79 -0
- package/dist/cjs/electron/media-controller.js +251 -0
- package/dist/cjs/electron/media-controller.js.map +1 -0
- package/dist/cjs/electron/network-monitor.d.ts +61 -0
- package/dist/cjs/electron/network-monitor.js +124 -0
- package/dist/cjs/electron/network-monitor.js.map +1 -0
- package/dist/cjs/electron/preload.js.map +1 -1
- package/dist/cjs/electron/presentation-handler.d.ts +39 -4
- package/dist/cjs/electron/presentation-handler.js +191 -47
- package/dist/cjs/electron/presentation-handler.js.map +1 -1
- package/dist/cjs/electron/presentation-source.d.ts +76 -0
- package/dist/cjs/electron/presentation-source.js +132 -0
- package/dist/cjs/electron/presentation-source.js.map +1 -0
- package/dist/cjs/electron/session-service.d.ts +198 -24
- package/dist/cjs/electron/session-service.js +630 -248
- package/dist/cjs/electron/session-service.js.map +1 -1
- package/dist/cjs/electron/session-tracker.d.ts +82 -0
- package/dist/cjs/electron/session-tracker.js +225 -0
- package/dist/cjs/electron/session-tracker.js.map +1 -0
- package/dist/cjs/electron/sink-service.d.ts +246 -0
- package/dist/cjs/electron/sink-service.js +606 -0
- package/dist/cjs/electron/sink-service.js.map +1 -0
- package/dist/cjs/electron/wired-display/controller.d.ts +76 -0
- package/dist/cjs/electron/wired-display/controller.js +198 -0
- package/dist/cjs/electron/wired-display/controller.js.map +1 -0
- package/dist/cjs/electron/wired-display/displays.d.ts +44 -0
- package/dist/cjs/electron/wired-display/displays.js +98 -0
- package/dist/cjs/electron/wired-display/displays.js.map +1 -0
- package/dist/cjs/electron/wired-display/electron-windows.d.ts +111 -0
- package/dist/cjs/electron/wired-display/electron-windows.js +306 -0
- package/dist/cjs/electron/wired-display/electron-windows.js.map +1 -0
- package/dist/cjs/electron/wired-display/index.d.ts +90 -0
- package/dist/cjs/electron/wired-display/index.js +115 -0
- package/dist/cjs/electron/wired-display/index.js.map +1 -0
- package/dist/cjs/electron/wired-display/local-presentation.d.ts +98 -0
- package/dist/cjs/electron/wired-display/local-presentation.js +234 -0
- package/dist/cjs/electron/wired-display/local-presentation.js.map +1 -0
- package/dist/cjs/electron/wired-display/provider.d.ts +112 -0
- package/dist/cjs/electron/wired-display/provider.js +202 -0
- package/dist/cjs/electron/wired-display/provider.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mirroring/backend.d.ts +76 -0
- package/dist/cjs/mirroring/backend.js +21 -0
- package/dist/cjs/mirroring/backend.js.map +1 -0
- package/dist/cjs/mirroring/electron/agent-protocol.d.ts +158 -0
- package/dist/cjs/mirroring/electron/agent-protocol.js +11 -0
- package/dist/cjs/mirroring/electron/agent-protocol.js.map +1 -0
- package/dist/cjs/mirroring/electron/agent-source.d.ts +20 -0
- package/dist/cjs/mirroring/electron/agent-source.js +621 -0
- package/dist/cjs/mirroring/electron/agent-source.js.map +1 -0
- package/dist/cjs/mirroring/electron/engine-process.d.ts +87 -0
- package/dist/cjs/mirroring/electron/engine-process.js +81 -0
- package/dist/cjs/mirroring/electron/engine-process.js.map +1 -0
- package/dist/cjs/mirroring/electron/host.d.ts +89 -0
- package/dist/cjs/mirroring/electron/host.js +321 -0
- package/dist/cjs/mirroring/electron/host.js.map +1 -0
- package/dist/cjs/mirroring/electron/port-backend.d.ts +107 -0
- package/dist/cjs/mirroring/electron/port-backend.js +446 -0
- package/dist/cjs/mirroring/electron/port-backend.js.map +1 -0
- package/dist/cjs/mirroring/encoding-support.d.ts +66 -0
- package/dist/cjs/mirroring/encoding-support.js +89 -0
- package/dist/cjs/mirroring/encoding-support.js.map +1 -0
- package/dist/cjs/mirroring/engine.d.ts +16 -0
- package/dist/cjs/mirroring/engine.js +78 -0
- package/dist/cjs/mirroring/engine.js.map +1 -0
- package/dist/cjs/mirroring/mirror-settings.d.ts +101 -0
- package/dist/cjs/mirroring/mirror-settings.js +140 -0
- package/dist/cjs/mirroring/mirror-settings.js.map +1 -0
- package/dist/cjs/mirroring/mirroring-activity.d.ts +207 -0
- package/dist/cjs/mirroring/mirroring-activity.js +367 -0
- package/dist/cjs/mirroring/mirroring-activity.js.map +1 -0
- package/dist/cjs/mirroring/mirroring-manager.d.ts +134 -0
- package/dist/cjs/mirroring/mirroring-manager.js +286 -0
- package/dist/cjs/mirroring/mirroring-manager.js.map +1 -0
- package/dist/cjs/mirroring/protocol/answer.d.ts +87 -0
- package/dist/cjs/mirroring/protocol/answer.js +233 -0
- package/dist/cjs/mirroring/protocol/answer.js.map +1 -0
- package/dist/cjs/mirroring/protocol/constants.d.ts +64 -0
- package/dist/cjs/mirroring/protocol/constants.js +70 -0
- package/dist/cjs/mirroring/protocol/constants.js.map +1 -0
- package/dist/cjs/mirroring/protocol/errors.d.ts +25 -0
- package/dist/cjs/mirroring/protocol/errors.js +34 -0
- package/dist/cjs/mirroring/protocol/errors.js.map +1 -0
- package/dist/cjs/mirroring/protocol/frame-id.d.ts +9 -0
- package/dist/cjs/mirroring/protocol/frame-id.js +24 -0
- package/dist/cjs/mirroring/protocol/frame-id.js.map +1 -0
- package/dist/cjs/mirroring/protocol/messenger.d.ts +42 -0
- package/dist/cjs/mirroring/protocol/messenger.js +122 -0
- package/dist/cjs/mirroring/protocol/messenger.js.map +1 -0
- package/dist/cjs/mirroring/protocol/offer.d.ts +109 -0
- package/dist/cjs/mirroring/protocol/offer.js +192 -0
- package/dist/cjs/mirroring/protocol/offer.js.map +1 -0
- package/dist/cjs/mirroring/protocol/recommendations.d.ts +28 -0
- package/dist/cjs/mirroring/protocol/recommendations.js +103 -0
- package/dist/cjs/mirroring/protocol/recommendations.js.map +1 -0
- package/dist/cjs/mirroring/routing.d.ts +60 -0
- package/dist/cjs/mirroring/routing.js +147 -0
- package/dist/cjs/mirroring/routing.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/ntp.d.ts +27 -0
- package/dist/cjs/mirroring/rtcp/ntp.js +62 -0
- package/dist/cjs/mirroring/rtcp/ntp.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/parser.d.ts +50 -0
- package/dist/cjs/mirroring/rtcp/parser.js +270 -0
- package/dist/cjs/mirroring/rtcp/parser.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/sender-report.d.ts +32 -0
- package/dist/cjs/mirroring/rtcp/sender-report.js +56 -0
- package/dist/cjs/mirroring/rtcp/sender-report.js.map +1 -0
- package/dist/cjs/mirroring/rtcp/wire.d.ts +54 -0
- package/dist/cjs/mirroring/rtcp/wire.js +73 -0
- package/dist/cjs/mirroring/rtcp/wire.js.map +1 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.d.ts +11 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.js +39 -0
- package/dist/cjs/mirroring/rtp/frame-crypto.js.map +1 -0
- package/dist/cjs/mirroring/rtp/frame.d.ts +23 -0
- package/dist/cjs/mirroring/rtp/frame.js +3 -0
- package/dist/cjs/mirroring/rtp/frame.js.map +1 -0
- package/dist/cjs/mirroring/rtp/packetizer.d.ts +27 -0
- package/dist/cjs/mirroring/rtp/packetizer.js +92 -0
- package/dist/cjs/mirroring/rtp/packetizer.js.map +1 -0
- package/dist/cjs/mirroring/sender/audio-sender.d.ts +23 -0
- package/dist/cjs/mirroring/sender/audio-sender.js +52 -0
- package/dist/cjs/mirroring/sender/audio-sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.d.ts +26 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.js +107 -0
- package/dist/cjs/mirroring/sender/bandwidth-estimator.js.map +1 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.d.ts +121 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.js +440 -0
- package/dist/cjs/mirroring/sender/capture-size-oracle.js.map +1 -0
- package/dist/cjs/mirroring/sender/frame-sender.d.ts +103 -0
- package/dist/cjs/mirroring/sender/frame-sender.js +217 -0
- package/dist/cjs/mirroring/sender/frame-sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/packet-router.d.ts +74 -0
- package/dist/cjs/mirroring/sender/packet-router.js +196 -0
- package/dist/cjs/mirroring/sender/packet-router.js.map +1 -0
- package/dist/cjs/mirroring/sender/sender-session.d.ts +85 -0
- package/dist/cjs/mirroring/sender/sender-session.js +240 -0
- package/dist/cjs/mirroring/sender/sender-session.js.map +1 -0
- package/dist/cjs/mirroring/sender/sender.d.ts +120 -0
- package/dist/cjs/mirroring/sender/sender.js +457 -0
- package/dist/cjs/mirroring/sender/sender.js.map +1 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.d.ts +29 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.js +64 -0
- package/dist/cjs/mirroring/sender/video-encoder-metrics.js.map +1 -0
- package/dist/cjs/mirroring/sender/video-sender.d.ts +95 -0
- package/dist/cjs/mirroring/sender/video-sender.js +183 -0
- package/dist/cjs/mirroring/sender/video-sender.js.map +1 -0
- package/dist/cjs/mirroring/session-host.d.ts +185 -0
- package/dist/cjs/mirroring/session-host.js +630 -0
- package/dist/cjs/mirroring/session-host.js.map +1 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.d.ts +11 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.js +123 -0
- package/dist/cjs/mirroring/stats/clock-offset-estimator.js.map +1 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.d.ts +12 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.js +21 -0
- package/dist/cjs/mirroring/stats/openscreen-stats-client.js.map +1 -0
- package/dist/cjs/mirroring/stats/sorted-map.d.ts +23 -0
- package/dist/cjs/mirroring/stats/sorted-map.js +70 -0
- package/dist/cjs/mirroring/stats/sorted-map.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.d.ts +50 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.js +339 -0
- package/dist/cjs/mirroring/stats/statistics-analyzer.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-collector.d.ts +29 -0
- package/dist/cjs/mirroring/stats/statistics-collector.js +53 -0
- package/dist/cjs/mirroring/stats/statistics-collector.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-common.d.ts +61 -0
- package/dist/cjs/mirroring/stats/statistics-common.js +45 -0
- package/dist/cjs/mirroring/stats/statistics-common.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.d.ts +28 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.js +104 -0
- package/dist/cjs/mirroring/stats/statistics-dispatcher.js.map +1 -0
- package/dist/cjs/mirroring/stats/statistics.d.ts +84 -0
- package/dist/cjs/mirroring/stats/statistics.js +147 -0
- package/dist/cjs/mirroring/stats/statistics.js.map +1 -0
- package/dist/cjs/mirroring/transport/udp-environment.d.ts +40 -0
- package/dist/cjs/mirroring/transport/udp-environment.js +97 -0
- package/dist/cjs/mirroring/transport/udp-environment.js.map +1 -0
- package/dist/cjs/polyfill/bridge-types.d.ts +11 -0
- package/dist/cjs/polyfill/presentation-receiver.d.ts +12 -0
- package/dist/cjs/polyfill/presentation-receiver.js +369 -0
- package/dist/cjs/polyfill/presentation-receiver.js.map +1 -0
- package/dist/cjs/polyfill/presentation-standin.js +157 -15
- package/dist/cjs/polyfill/presentation-standin.js.map +1 -1
- package/dist/cjs/protocol/framing.d.ts +1 -1
- package/dist/cjs/protocol/framing.js +1 -1
- package/dist/cjs/protocol/framing.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +56 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/auth/build-time.js +1 -1
- package/dist/client/auth/cast-auth.d.ts +2 -0
- package/dist/client/auth/cast-auth.js.map +1 -1
- package/dist/dial/dial-registry.d.ts +104 -0
- package/dist/dial/dial-registry.js +297 -0
- package/dist/dial/dial-registry.js.map +1 -0
- package/dist/dial/dial-sink-service.d.ts +108 -0
- package/dist/dial/dial-sink-service.js +310 -0
- package/dist/dial/dial-sink-service.js.map +1 -0
- package/dist/dial/http.d.ts +40 -0
- package/dist/dial/http.js +165 -0
- package/dist/dial/http.js.map +1 -0
- package/dist/dial/index.d.ts +63 -0
- package/dist/dial/index.js +115 -0
- package/dist/dial/index.js.map +1 -0
- package/dist/dial/origins.d.ts +4 -0
- package/dist/dial/origins.js +32 -0
- package/dist/dial/origins.js.map +1 -0
- package/dist/dial/parse.d.ts +101 -0
- package/dist/dial/parse.js +281 -0
- package/dist/dial/parse.js.map +1 -0
- package/dist/dial/route-provider.d.ts +96 -0
- package/dist/dial/route-provider.js +369 -0
- package/dist/dial/route-provider.js.map +1 -0
- package/dist/dial/ssdp-socket.d.ts +34 -0
- package/dist/dial/ssdp-socket.js +65 -0
- package/dist/dial/ssdp-socket.js.map +1 -0
- package/dist/dial/xml.d.ts +13 -0
- package/dist/dial/xml.js +204 -0
- package/dist/dial/xml.js.map +1 -0
- package/dist/dial-test/cli-main.d.ts +17 -0
- package/dist/dial-test/cli-main.js +130 -0
- package/dist/dial-test/cli-main.js.map +1 -0
- package/dist/dial-test/report.d.ts +55 -0
- package/dist/dial-test/report.js +77 -0
- package/dist/dial-test/report.js.map +1 -0
- package/dist/dial-test/runner.d.ts +42 -0
- package/dist/dial-test/runner.js +566 -0
- package/dist/dial-test/runner.js.map +1 -0
- package/dist/dial-test/scrub.d.ts +14 -0
- package/dist/dial-test/scrub.js +73 -0
- package/dist/dial-test/scrub.js.map +1 -0
- package/dist/discovery/cast-discovery.d.ts +2 -0
- package/dist/discovery/cast-discovery.js.map +1 -1
- package/dist/discovery/device-cache.d.ts +9 -0
- package/dist/discovery/device-cache.js.map +1 -1
- package/dist/discovery/index.d.ts +1 -0
- package/dist/discovery/index.js +1 -0
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/ip-policy.d.ts +20 -0
- package/dist/discovery/ip-policy.js +103 -0
- package/dist/discovery/ip-policy.js.map +1 -0
- package/dist/discovery/udp-socket.d.ts +3 -0
- package/dist/discovery/udp-socket.js +3 -0
- package/dist/discovery/udp-socket.js.map +1 -1
- package/dist/electron/access-code.d.ts +221 -0
- package/dist/electron/access-code.js +577 -0
- package/dist/electron/access-code.js.map +1 -0
- package/dist/electron/app-discovery.d.ts +82 -0
- package/dist/electron/app-discovery.js +215 -0
- package/dist/electron/app-discovery.js.map +1 -0
- package/dist/electron/default-presentation.d.ts +38 -0
- package/dist/electron/default-presentation.js +83 -0
- package/dist/electron/default-presentation.js.map +1 -0
- package/dist/electron/main.d.ts +98 -11
- package/dist/electron/main.js +597 -21
- package/dist/electron/main.js.map +1 -1
- package/dist/electron/manager-api.d.ts +200 -18
- package/dist/electron/manager-api.js +196 -4
- package/dist/electron/manager-api.js.map +1 -1
- package/dist/electron/media-controller.d.ts +79 -0
- package/dist/electron/media-controller.js +248 -0
- package/dist/electron/media-controller.js.map +1 -0
- package/dist/electron/network-monitor.d.ts +61 -0
- package/dist/electron/network-monitor.js +117 -0
- package/dist/electron/network-monitor.js.map +1 -0
- package/dist/electron/preload.js.map +1 -1
- package/dist/electron/presentation-handler.d.ts +39 -4
- package/dist/electron/presentation-handler.js +192 -48
- package/dist/electron/presentation-handler.js.map +1 -1
- package/dist/electron/presentation-source.d.ts +76 -0
- package/dist/electron/presentation-source.js +125 -0
- package/dist/electron/presentation-source.js.map +1 -0
- package/dist/electron/session-service.d.ts +198 -24
- package/dist/electron/session-service.js +629 -248
- package/dist/electron/session-service.js.map +1 -1
- package/dist/electron/session-tracker.d.ts +82 -0
- package/dist/electron/session-tracker.js +219 -0
- package/dist/electron/session-tracker.js.map +1 -0
- package/dist/electron/sink-service.d.ts +246 -0
- package/dist/electron/sink-service.js +602 -0
- package/dist/electron/sink-service.js.map +1 -0
- package/dist/electron/wired-display/controller.d.ts +76 -0
- package/dist/electron/wired-display/controller.js +194 -0
- package/dist/electron/wired-display/controller.js.map +1 -0
- package/dist/electron/wired-display/displays.d.ts +44 -0
- package/dist/electron/wired-display/displays.js +91 -0
- package/dist/electron/wired-display/displays.js.map +1 -0
- package/dist/electron/wired-display/electron-windows.d.ts +111 -0
- package/dist/electron/wired-display/electron-windows.js +301 -0
- package/dist/electron/wired-display/electron-windows.js.map +1 -0
- package/dist/electron/wired-display/index.d.ts +90 -0
- package/dist/electron/wired-display/index.js +99 -0
- package/dist/electron/wired-display/index.js.map +1 -0
- package/dist/electron/wired-display/local-presentation.d.ts +98 -0
- package/dist/electron/wired-display/local-presentation.js +228 -0
- package/dist/electron/wired-display/local-presentation.js.map +1 -0
- package/dist/electron/wired-display/provider.d.ts +112 -0
- package/dist/electron/wired-display/provider.js +197 -0
- package/dist/electron/wired-display/provider.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mirroring/backend.d.ts +76 -0
- package/dist/mirroring/backend.js +18 -0
- package/dist/mirroring/backend.js.map +1 -0
- package/dist/mirroring/electron/agent-protocol.d.ts +158 -0
- package/dist/mirroring/electron/agent-protocol.js +10 -0
- package/dist/mirroring/electron/agent-protocol.js.map +1 -0
- package/dist/mirroring/electron/agent-source.d.ts +20 -0
- package/dist/mirroring/electron/agent-source.js +618 -0
- package/dist/mirroring/electron/agent-source.js.map +1 -0
- package/dist/mirroring/electron/engine-process.d.ts +87 -0
- package/dist/mirroring/electron/engine-process.js +78 -0
- package/dist/mirroring/electron/engine-process.js.map +1 -0
- package/dist/mirroring/electron/host.d.ts +89 -0
- package/dist/mirroring/electron/host.js +318 -0
- package/dist/mirroring/electron/host.js.map +1 -0
- package/dist/mirroring/electron/port-backend.d.ts +107 -0
- package/dist/mirroring/electron/port-backend.js +441 -0
- package/dist/mirroring/electron/port-backend.js.map +1 -0
- package/dist/mirroring/encoding-support.d.ts +66 -0
- package/dist/mirroring/encoding-support.js +81 -0
- package/dist/mirroring/encoding-support.js.map +1 -0
- package/dist/mirroring/engine.d.ts +16 -0
- package/dist/mirroring/engine.js +75 -0
- package/dist/mirroring/engine.js.map +1 -0
- package/dist/mirroring/mirror-settings.d.ts +101 -0
- package/dist/mirroring/mirror-settings.js +134 -0
- package/dist/mirroring/mirror-settings.js.map +1 -0
- package/dist/mirroring/mirroring-activity.d.ts +207 -0
- package/dist/mirroring/mirroring-activity.js +362 -0
- package/dist/mirroring/mirroring-activity.js.map +1 -0
- package/dist/mirroring/mirroring-manager.d.ts +134 -0
- package/dist/mirroring/mirroring-manager.js +281 -0
- package/dist/mirroring/mirroring-manager.js.map +1 -0
- package/dist/mirroring/protocol/answer.d.ts +87 -0
- package/dist/mirroring/protocol/answer.js +226 -0
- package/dist/mirroring/protocol/answer.js.map +1 -0
- package/dist/mirroring/protocol/constants.d.ts +64 -0
- package/dist/mirroring/protocol/constants.js +66 -0
- package/dist/mirroring/protocol/constants.js.map +1 -0
- package/dist/mirroring/protocol/errors.d.ts +25 -0
- package/dist/mirroring/protocol/errors.js +29 -0
- package/dist/mirroring/protocol/errors.js.map +1 -0
- package/dist/mirroring/protocol/frame-id.d.ts +9 -0
- package/dist/mirroring/protocol/frame-id.js +20 -0
- package/dist/mirroring/protocol/frame-id.js.map +1 -0
- package/dist/mirroring/protocol/messenger.d.ts +42 -0
- package/dist/mirroring/protocol/messenger.js +118 -0
- package/dist/mirroring/protocol/messenger.js.map +1 -0
- package/dist/mirroring/protocol/offer.d.ts +109 -0
- package/dist/mirroring/protocol/offer.js +176 -0
- package/dist/mirroring/protocol/offer.js.map +1 -0
- package/dist/mirroring/protocol/recommendations.d.ts +28 -0
- package/dist/mirroring/protocol/recommendations.js +99 -0
- package/dist/mirroring/protocol/recommendations.js.map +1 -0
- package/dist/mirroring/routing.d.ts +60 -0
- package/dist/mirroring/routing.js +130 -0
- package/dist/mirroring/routing.js.map +1 -0
- package/dist/mirroring/rtcp/ntp.d.ts +27 -0
- package/dist/mirroring/rtcp/ntp.js +57 -0
- package/dist/mirroring/rtcp/ntp.js.map +1 -0
- package/dist/mirroring/rtcp/parser.d.ts +50 -0
- package/dist/mirroring/rtcp/parser.js +265 -0
- package/dist/mirroring/rtcp/parser.js.map +1 -0
- package/dist/mirroring/rtcp/sender-report.d.ts +32 -0
- package/dist/mirroring/rtcp/sender-report.js +51 -0
- package/dist/mirroring/rtcp/sender-report.js.map +1 -0
- package/dist/mirroring/rtcp/wire.d.ts +54 -0
- package/dist/mirroring/rtcp/wire.js +68 -0
- package/dist/mirroring/rtcp/wire.js.map +1 -0
- package/dist/mirroring/rtp/frame-crypto.d.ts +11 -0
- package/dist/mirroring/rtp/frame-crypto.js +35 -0
- package/dist/mirroring/rtp/frame-crypto.js.map +1 -0
- package/dist/mirroring/rtp/frame.d.ts +23 -0
- package/dist/mirroring/rtp/frame.js +2 -0
- package/dist/mirroring/rtp/frame.js.map +1 -0
- package/dist/mirroring/rtp/packetizer.d.ts +27 -0
- package/dist/mirroring/rtp/packetizer.js +88 -0
- package/dist/mirroring/rtp/packetizer.js.map +1 -0
- package/dist/mirroring/sender/audio-sender.d.ts +23 -0
- package/dist/mirroring/sender/audio-sender.js +54 -0
- package/dist/mirroring/sender/audio-sender.js.map +1 -0
- package/dist/mirroring/sender/bandwidth-estimator.d.ts +26 -0
- package/dist/mirroring/sender/bandwidth-estimator.js +103 -0
- package/dist/mirroring/sender/bandwidth-estimator.js.map +1 -0
- package/dist/mirroring/sender/capture-size-oracle.d.ts +121 -0
- package/dist/mirroring/sender/capture-size-oracle.js +433 -0
- package/dist/mirroring/sender/capture-size-oracle.js.map +1 -0
- package/dist/mirroring/sender/frame-sender.d.ts +103 -0
- package/dist/mirroring/sender/frame-sender.js +212 -0
- package/dist/mirroring/sender/frame-sender.js.map +1 -0
- package/dist/mirroring/sender/packet-router.d.ts +74 -0
- package/dist/mirroring/sender/packet-router.js +191 -0
- package/dist/mirroring/sender/packet-router.js.map +1 -0
- package/dist/mirroring/sender/sender-session.d.ts +85 -0
- package/dist/mirroring/sender/sender-session.js +235 -0
- package/dist/mirroring/sender/sender-session.js.map +1 -0
- package/dist/mirroring/sender/sender.d.ts +120 -0
- package/dist/mirroring/sender/sender.js +452 -0
- package/dist/mirroring/sender/sender.js.map +1 -0
- package/dist/mirroring/sender/video-encoder-metrics.d.ts +29 -0
- package/dist/mirroring/sender/video-encoder-metrics.js +58 -0
- package/dist/mirroring/sender/video-encoder-metrics.js.map +1 -0
- package/dist/mirroring/sender/video-sender.d.ts +95 -0
- package/dist/mirroring/sender/video-sender.js +190 -0
- package/dist/mirroring/sender/video-sender.js.map +1 -0
- package/dist/mirroring/session-host.d.ts +185 -0
- package/dist/mirroring/session-host.js +625 -0
- package/dist/mirroring/session-host.js.map +1 -0
- package/dist/mirroring/stats/clock-offset-estimator.d.ts +11 -0
- package/dist/mirroring/stats/clock-offset-estimator.js +120 -0
- package/dist/mirroring/stats/clock-offset-estimator.js.map +1 -0
- package/dist/mirroring/stats/openscreen-stats-client.d.ts +12 -0
- package/dist/mirroring/stats/openscreen-stats-client.js +17 -0
- package/dist/mirroring/stats/openscreen-stats-client.js.map +1 -0
- package/dist/mirroring/stats/sorted-map.d.ts +23 -0
- package/dist/mirroring/stats/sorted-map.js +66 -0
- package/dist/mirroring/stats/sorted-map.js.map +1 -0
- package/dist/mirroring/stats/statistics-analyzer.d.ts +50 -0
- package/dist/mirroring/stats/statistics-analyzer.js +335 -0
- package/dist/mirroring/stats/statistics-analyzer.js.map +1 -0
- package/dist/mirroring/stats/statistics-collector.d.ts +29 -0
- package/dist/mirroring/stats/statistics-collector.js +49 -0
- package/dist/mirroring/stats/statistics-collector.js.map +1 -0
- package/dist/mirroring/stats/statistics-common.d.ts +61 -0
- package/dist/mirroring/stats/statistics-common.js +39 -0
- package/dist/mirroring/stats/statistics-common.js.map +1 -0
- package/dist/mirroring/stats/statistics-dispatcher.d.ts +28 -0
- package/dist/mirroring/stats/statistics-dispatcher.js +100 -0
- package/dist/mirroring/stats/statistics-dispatcher.js.map +1 -0
- package/dist/mirroring/stats/statistics.d.ts +84 -0
- package/dist/mirroring/stats/statistics.js +141 -0
- package/dist/mirroring/stats/statistics.js.map +1 -0
- package/dist/mirroring/transport/udp-environment.d.ts +40 -0
- package/dist/mirroring/transport/udp-environment.js +93 -0
- package/dist/mirroring/transport/udp-environment.js.map +1 -0
- package/dist/polyfill/bridge-types.d.ts +11 -0
- package/dist/polyfill/presentation-receiver.d.ts +12 -0
- package/dist/polyfill/presentation-receiver.js +366 -0
- package/dist/polyfill/presentation-receiver.js.map +1 -0
- package/dist/polyfill/presentation-standin.js +157 -15
- package/dist/polyfill/presentation-standin.js.map +1 -1
- package/dist/protocol/framing.d.ts +1 -1
- package/dist/protocol/framing.js +1 -1
- package/dist/protocol/framing.js.map +1 -1
- package/docs/API.md +724 -0
- package/docs/ARCHITECTURE.md +242 -0
- package/docs/CHROMIUM-MAP.md +176 -0
- package/docs/DESIGN.md +1189 -0
- package/docs/FAQ.md +123 -0
- package/docs/GETTING-STARTED.md +248 -0
- package/docs/MAIN-API.md +524 -0
- package/docs/TROUBLESHOOTING.md +283 -0
- package/docs/guides/audio-and-groups.md +75 -0
- package/docs/guides/custom-receivers.md +109 -0
- package/docs/guides/device-authentication.md +145 -0
- package/docs/guides/device-picker.md +176 -0
- package/docs/guides/index.md +17 -0
- package/docs/guides/low-level-client.md +103 -0
- package/docs/guides/restart-rejoin.md +172 -0
- package/docs/guides/testing.md +162 -0
- package/docs/guides/windows-and-iframes.md +116 -0
- package/docs/readme/badges/dependencies.svg +1 -0
- package/docs/readme/badges/electron.svg +1 -0
- package/docs/readme/badges/license.svg +1 -0
- package/docs/readme/badges/node.svg +1 -0
- package/docs/readme/board.jpg +0 -0
- package/docs/readme/hero-dark.jpg +0 -0
- package/docs/readme/hero-light.jpg +0 -0
- package/docs/readme/nosignal.jpg +0 -0
- package/docs/readme/parity.jpg +0 -0
- package/docs/readme/trace.svg +22 -0
- package/package.json +21 -5
- package/src/cli.ts +57 -0
- package/src/client/auth/cast-auth.ts +2 -0
- package/src/dial/dial-registry.ts +316 -0
- package/src/dial/dial-sink-service.ts +343 -0
- package/src/dial/http.ts +200 -0
- package/src/dial/index.ts +135 -0
- package/src/dial/origins.ts +31 -0
- package/src/dial/parse.ts +319 -0
- package/src/dial/route-provider.ts +429 -0
- package/src/dial/ssdp-socket.ts +79 -0
- package/src/dial/xml.ts +180 -0
- package/src/dial-test/cli-main.ts +146 -0
- package/src/dial-test/report.ts +109 -0
- package/src/dial-test/runner.ts +615 -0
- package/src/dial-test/scrub.ts +74 -0
- package/src/discovery/cast-discovery.ts +2 -0
- package/src/discovery/device-cache.ts +5 -0
- package/src/discovery/index.ts +1 -0
- package/src/discovery/ip-policy.ts +97 -0
- package/src/discovery/udp-socket.ts +3 -0
- package/src/electron/access-code.ts +681 -0
- package/src/electron/app-discovery.ts +244 -0
- package/src/electron/default-presentation.ts +104 -0
- package/src/electron/main.ts +664 -29
- package/src/electron/manager-api.ts +367 -15
- package/src/electron/media-controller.ts +313 -0
- package/src/electron/network-monitor.ts +140 -0
- package/src/electron/preload.ts +1 -1
- package/src/electron/presentation-handler.ts +195 -48
- package/src/electron/presentation-source.ts +155 -0
- package/src/electron/session-service.ts +693 -238
- package/src/electron/session-tracker.ts +248 -0
- package/src/electron/sink-service.ts +726 -0
- package/src/electron/wired-display/controller.ts +212 -0
- package/src/electron/wired-display/displays.ts +107 -0
- package/src/electron/wired-display/electron-windows.ts +386 -0
- package/src/electron/wired-display/index.ts +181 -0
- package/src/electron/wired-display/local-presentation.ts +286 -0
- package/src/electron/wired-display/provider.ts +276 -0
- package/src/index.ts +1 -0
- package/src/mirroring/backend.ts +103 -0
- package/src/mirroring/electron/agent-protocol.ts +84 -0
- package/src/mirroring/electron/agent-source.ts +619 -0
- package/src/mirroring/electron/engine-process.ts +131 -0
- package/src/mirroring/electron/host.ts +361 -0
- package/src/mirroring/electron/port-backend.ts +466 -0
- package/src/mirroring/encoding-support.ts +146 -0
- package/src/mirroring/engine.ts +91 -0
- package/src/mirroring/mirror-settings.ts +174 -0
- package/src/mirroring/mirroring-activity.ts +466 -0
- package/src/mirroring/mirroring-manager.ts +342 -0
- package/src/mirroring/protocol/answer.ts +285 -0
- package/src/mirroring/protocol/constants.ts +75 -0
- package/src/mirroring/protocol/errors.ts +36 -0
- package/src/mirroring/protocol/frame-id.ts +20 -0
- package/src/mirroring/protocol/messenger.ts +128 -0
- package/src/mirroring/protocol/offer.ts +275 -0
- package/src/mirroring/protocol/recommendations.ts +135 -0
- package/src/mirroring/routing.ts +160 -0
- package/src/mirroring/rtcp/ntp.ts +61 -0
- package/src/mirroring/rtcp/parser.ts +292 -0
- package/src/mirroring/rtcp/sender-report.ts +88 -0
- package/src/mirroring/rtcp/wire.ts +76 -0
- package/src/mirroring/rtp/frame-crypto.ts +38 -0
- package/src/mirroring/rtp/frame.ts +25 -0
- package/src/mirroring/rtp/packetizer.ts +95 -0
- package/src/mirroring/sender/audio-sender.ts +59 -0
- package/src/mirroring/sender/bandwidth-estimator.ts +111 -0
- package/src/mirroring/sender/capture-size-oracle.ts +476 -0
- package/src/mirroring/sender/frame-sender.ts +293 -0
- package/src/mirroring/sender/packet-router.ts +228 -0
- package/src/mirroring/sender/sender-session.ts +306 -0
- package/src/mirroring/sender/sender.ts +497 -0
- package/src/mirroring/sender/video-encoder-metrics.ts +64 -0
- package/src/mirroring/sender/video-sender.ts +243 -0
- package/src/mirroring/session-host.ts +725 -0
- package/src/mirroring/stats/clock-offset-estimator.ts +139 -0
- package/src/mirroring/stats/openscreen-stats-client.ts +19 -0
- package/src/mirroring/stats/sorted-map.ts +68 -0
- package/src/mirroring/stats/statistics-analyzer.ts +388 -0
- package/src/mirroring/stats/statistics-collector.ts +69 -0
- package/src/mirroring/stats/statistics-common.ts +112 -0
- package/src/mirroring/stats/statistics-dispatcher.ts +133 -0
- package/src/mirroring/stats/statistics.ts +170 -0
- package/src/mirroring/transport/udp-environment.ts +100 -0
- package/src/polyfill/bridge-types.ts +11 -0
- package/src/polyfill/presentation-receiver.ts +350 -0
- package/src/polyfill/presentation-standin.ts +147 -15
- package/src/protocol/framing.ts +1 -1
package/README.md
CHANGED
|
@@ -1,31 +1,48 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://adammpkins.github.io/electron-cast/">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/readme/hero-dark.jpg">
|
|
5
|
+
<img src="docs/readme/hero-light.jpg" width="100%" alt="The electron-cast front page: the headline 'Chromecast for Electron.' in heavy condensed type on a faint blueprint grid, a one-line explanation that Electron ships the Presentation API with nothing behind it, the install command npm install electron-cast, a Read the docs button and a link to the source on GitHub.">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
1
10
|
# electron-cast
|
|
2
11
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
12
|
+
<p>
|
|
13
|
+
<img src="docs/readme/badges/node.svg" alt="node >=20">
|
|
14
|
+
<img src="docs/readme/badges/electron.svg" alt="electron >=35">
|
|
15
|
+
<img src="docs/readme/badges/license.svg" alt="license MIT">
|
|
16
|
+
<img src="docs/readme/badges/dependencies.svg" alt="runtime dependencies 0">
|
|
17
|
+
<a href="https://github.com/adammpkins/electron-cast/actions/workflows/ci.yml"><img src="https://github.com/adammpkins/electron-cast/actions/workflows/ci.yml/badge.svg" alt="GitHub CI"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
**Google's own Cast SDK, running unchanged in your Electron app.** Docs: [adammpkins.github.io/electron-cast](https://adammpkins.github.io/electron-cast/).
|
|
6
21
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
unchanged.
|
|
22
|
+
Chrome's Cast support for Electron: pages run Google's own, unmodified Cast SDK, and your main process supplies the
|
|
23
|
+
Media Router that Electron lacks.
|
|
10
24
|
|
|
11
|
-
|
|
25
|
+
Electron has the Presentation API but nothing behind it, and electron/electron#869 (a Media Router for Electron) was
|
|
26
|
+
closed in 2025 with no plans to add one. electron-cast fills that gap from scratch: a stand-in Presentation API in the
|
|
27
|
+
page, and in the main process mDNS discovery, a device picker hook, the Cast v2 channel, device authentication with
|
|
28
|
+
Chrome's certificate checks, and the message envelope Chrome's Media Router speaks to the SDK. A site's own cast
|
|
29
|
+
button (YouTube Music's, for example) works unchanged. No native modules, no runtime dependencies, and it works with
|
|
30
|
+
`sandbox: true` and `contextIsolation: true`.
|
|
12
31
|
|
|
13
32
|
```sh
|
|
14
33
|
npm install electron-cast
|
|
15
34
|
```
|
|
16
35
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(`npm run smoke` runs it locally once you have installed Electron).
|
|
36
|
+
- [Getting started](docs/GETTING-STARTED.md): from zero to casting, with packaging notes for each OS.
|
|
37
|
+
- [Guides](docs/guides/index.md): a device picker, restart rejoin, iframes, custom receivers, testing.
|
|
38
|
+
- [API reference](docs/API.md), [main-process API](docs/MAIN-API.md), [architecture](docs/ARCHITECTURE.md),
|
|
39
|
+
[troubleshooting](docs/TROUBLESHOOTING.md), [FAQ](docs/FAQ.md), [security](SECURITY.md), [changelog](CHANGELOG.md).
|
|
22
40
|
|
|
23
|
-
|
|
24
|
-
frozen fallback (see below).
|
|
41
|
+
## Quick start
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
Four small pieces. Needs Electron 35 or later and Node 20 or later.
|
|
27
44
|
|
|
28
|
-
**Main process.** Create one manager,
|
|
45
|
+
**1. Main process.** Create one manager, say which pages may cast, and show a picker when the page asks:
|
|
29
46
|
|
|
30
47
|
```ts
|
|
31
48
|
import { app, ipcMain, Menu } from "electron";
|
|
@@ -45,11 +62,15 @@ const cast = createCastManager({
|
|
|
45
62
|
}),
|
|
46
63
|
});
|
|
47
64
|
|
|
48
|
-
await
|
|
65
|
+
// Not a top-level `await app.whenReady()`: see the Electron 45 note in docs/TROUBLESHOOTING.md.
|
|
66
|
+
app.whenReady().then(async () => {
|
|
67
|
+
await cast.start();
|
|
68
|
+
// create your windows here
|
|
69
|
+
});
|
|
49
70
|
app.on("will-quit", () => void cast.dispose());
|
|
50
71
|
```
|
|
51
72
|
|
|
52
|
-
**Preload
|
|
73
|
+
**2. Preload** of the window or view that shows the page:
|
|
53
74
|
|
|
54
75
|
```ts
|
|
55
76
|
import { contextBridge, ipcRenderer } from "electron";
|
|
@@ -58,173 +79,198 @@ import { installCastBridge } from "electron-cast/preload";
|
|
|
58
79
|
installCastBridge({ contextBridge, ipcRenderer });
|
|
59
80
|
```
|
|
60
81
|
|
|
61
|
-
|
|
62
|
-
Node's `tls` and `dgram
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
browser process; Electron has no main-process API for it, so the preload reads `navigator.userActivation.isActive` in
|
|
79
|
-
its own isolated world when the page asks to start, and the main process refuses a start without it. A page's scripts
|
|
80
|
-
cannot forge that, a compromised renderer could (see [SECURITY.md](SECURITY.md#user-gesture)). `mode: "chromecast"` has
|
|
81
|
-
no gesture check.
|
|
82
|
-
|
|
83
|
-
**Reloads and restarts.** As in Chrome, a session belongs to the app rather than the page, so a page that reloads gets
|
|
84
|
-
its session back through auto-join.
|
|
85
|
-
|
|
86
|
-
After the Electron app itself restarts, a session may still be playing on the device. electron-cast saves nothing for
|
|
87
|
-
that, and auto-join does not find it (Chrome's auto-join only joins sessions started by that browser run). The app
|
|
88
|
-
persists the session id and the page reconnects with it: Google's SDK exposes the id as `session.sessionId`, so the page
|
|
89
|
-
keeps it (in `localStorage`, say) and calls `chrome.cast.requestSessionById(id)` (or `cast.framework`'s equivalent) at
|
|
90
|
-
startup. The SDK turns that into `PresentationRequest.reconnect("cast-session_<id>")`, which reaches electron-cast's
|
|
91
|
-
`joinRunningSession`: it asks the known devices which one runs that session and joins it if the app matches, with no
|
|
92
|
-
origin check (Chrome's `AppActivity::CanJoinSession` checks only the app id and that the client is not already
|
|
93
|
-
connected), also when this run already holds the session; `allowOrigin` still applies first. If the device no longer
|
|
94
|
-
runs the session, the call fails like in Chrome. Discovery has to have found the device by then, so the page may need
|
|
95
|
-
to retry for a few seconds after startup. `mode: "chromecast"` does not do this.
|
|
96
|
-
|
|
97
|
-
**Iframes (presentation mode only).** Google's SDK also works inside an iframe (an embedded player, say). As in Chrome,
|
|
98
|
-
each frame is its own controlling context: its availability watches, connections and sessions belong to that frame, its
|
|
99
|
-
events reach only that frame, and it can't read, close or message another frame's connections. The origin electron-cast
|
|
100
|
-
uses (for `allowOrigin`, the device picker and origin-scoped auto-join) is the sending frame's own, so a cross-origin
|
|
101
|
-
iframe is its own origin. An iframe that navigates parks its sessions as a reloading page does, and is left for good when
|
|
102
|
-
it is removed or its page navigates. Electron only runs a preload in subframes if the app opts in:
|
|
103
|
-
|
|
104
|
-
```js
|
|
105
|
-
new BrowserWindow({
|
|
106
|
-
webPreferences: {
|
|
107
|
-
preload: path.join(__dirname, "preload.js"),
|
|
108
|
-
sandbox: true,
|
|
109
|
-
contextIsolation: true,
|
|
110
|
-
nodeIntegrationInSubFrames: true, // run the preload in iframes too
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Without `nodeIntegrationInSubFrames`, nothing changes: the preload runs only in the main frame, an iframe has no stand-in
|
|
116
|
-
and no cast, and its SDK finds no devices. With it, the preload (and so the cast bridge) runs in every iframe of every
|
|
117
|
-
origin, so keep `allowOrigin` strict. `nodeIntegration` stays `false`, so an iframe's page still gets no Node. The
|
|
118
|
-
frame handling is covered by unit tests against fake frames; the real-Electron smoke test does not load an iframe.
|
|
119
|
-
`mode: "chromecast"` stays main-frame only: a call from an iframe is refused.
|
|
120
|
-
|
|
121
|
-
**Fallback: `mode: "chromecast"`.** This installs electron-cast's own implementation of `chrome.cast` and
|
|
122
|
-
`chrome.cast.media` and blocks Google's loader scripts. Use it for pages that call `chrome.cast` without loading
|
|
123
|
-
Google's script, or if Google's script ever stops working on the stand-in:
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
installCastBridge({ contextBridge, ipcRenderer, mode: "chromecast" });
|
|
82
|
+
A sandboxed preload cannot load other files, so bundle it (esbuild, for example). Import from `electron-cast/preload`,
|
|
83
|
+
not the package root, which needs Node's `tls` and `dgram`. Why and how: [Getting started](docs/GETTING-STARTED.md#2-the-preload).
|
|
84
|
+
|
|
85
|
+
**3. The page** loads Google's Cast SDK as it would in Chrome. Nothing electron-cast specific:
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<google-cast-launcher></google-cast-launcher>
|
|
89
|
+
<script>
|
|
90
|
+
window.__onGCastApiAvailable = (available) => {
|
|
91
|
+
if (!available) return;
|
|
92
|
+
cast.framework.CastContext.getInstance().setOptions({
|
|
93
|
+
receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
|
|
94
|
+
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
|
|
127
99
|
```
|
|
128
100
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## Device authentication
|
|
132
|
-
|
|
133
|
-
Like Chrome, electron-cast checks that a device is a genuine Google-certified Cast device before using it (the
|
|
134
|
-
`deviceauth` challenge, with Google's Cast root certificates built in and no dependencies). This happens when the
|
|
135
|
-
connection opens, not at discovery, so a device that fails still shows in the picker but casting to it fails like an
|
|
136
|
-
unreachable device.
|
|
137
|
-
|
|
138
|
-
On by default; receivers that are not Google-certified (open-source ones, for example) need it off:
|
|
101
|
+
**4. Run it.** The [example app](examples/electron-app) is exactly this, runnable: clone the repository, then
|
|
139
102
|
|
|
140
|
-
```
|
|
141
|
-
|
|
103
|
+
```sh
|
|
104
|
+
npm install && npm run build
|
|
105
|
+
cd examples/electron-app && npm install && npm start
|
|
142
106
|
```
|
|
143
107
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
108
|
+
Click the cast button, pick a device, then "Play sample video". With no Cast device on the network the button stays
|
|
109
|
+
hidden.
|
|
110
|
+
|
|
111
|
+
<div align="center">
|
|
112
|
+
<img src="docs/readme/trace.svg" width="100%" alt="A recorded Cast v2 session between electron-cast 0.4.0 and a Chromecast Ultra, replayed as a log: device authentication, CONNECT, GET_STATUS, LAUNCH of the Default Media Receiver, RECEIVER_STATUS, media LOAD, MEDIA_STATUS moving from buffering to playing, PING and PONG, PAUSE and PLAY, then STOP and CLOSE. ON AIR lights from LOAD to STOP.">
|
|
113
|
+
<br><sub>A real session, frame by frame. Silences over 1.5 seconds are marked and shortened.</sub>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
## What you get
|
|
117
|
+
|
|
118
|
+
- **Google's own SDK, unmodified.** The page's `cast_sender.js` and `cast.framework` run as in Chrome. electron-cast
|
|
119
|
+
never replaces them.
|
|
120
|
+
- **Discovery and device tracking as in Chrome's Media Router.** mDNS (`_googlecast._tcp`) on every network
|
|
121
|
+
interface, IPv4 and IPv6, then a kept-open channel to each device found. A device is listed once that channel is open
|
|
122
|
+
and authenticated, so the list fills in a few seconds after `start()`; it stays through mDNS silence and recovers
|
|
123
|
+
after sleep.
|
|
124
|
+
- **DIAL next to Cast**, as Chrome runs both: SSDP discovery, availability, the picker and launch over HTTP for the
|
|
125
|
+
`cast-dial:` sources Google's SDK adds for a `dialRequest`. On by default; `dial: false` turns it off. (0.5)
|
|
126
|
+
- **Tab and desktop mirroring** to a Cast device, and **presenting to a second monitor** (a wired display), started from
|
|
127
|
+
the main process ([docs](docs/MAIN-API.md#tab-and-desktop-mirroring)). (0.5)
|
|
128
|
+
- **Device authentication** as Chrome does it: a device is listed only after it proves it is a Google-certified Cast
|
|
129
|
+
device, with Google's Cast roots built in ([details](docs/guides/device-authentication.md)).
|
|
130
|
+
- **Sessions the Chrome way:** auto-join after a reload, rejoin after an app restart by session id, several windows,
|
|
131
|
+
and iframes.
|
|
132
|
+
- **A picker hook, not a picker.** You decide which pages may cast and show whatever UI you like
|
|
133
|
+
([guide](docs/guides/device-picker.md)).
|
|
134
|
+
- **A main-process API** modelled on Chrome's Media Router: observe devices (sinks) and sessions (routes), including
|
|
135
|
+
sessions other senders started; stop or detach a session, set its volume; play, pause and seek its media; and start
|
|
136
|
+
a cast from your own menu on the page's default presentation request ([docs](docs/MAIN-API.md)). The sessions of
|
|
137
|
+
other senders, media control and casting from your menu are new in 0.5.
|
|
138
|
+
- **Every layer is exported** if you want them without Electron: `CastDiscovery`, `CastClient` and the protocol code
|
|
139
|
+
run in plain Node ([guide](docs/guides/low-level-client.md)).
|
|
140
|
+
- **Documented against Chromium.** Where electron-cast copies a rule, the code and docs name the Chromium source it
|
|
141
|
+
comes from ([map](docs/CHROMIUM-MAP.md)).
|
|
142
|
+
|
|
143
|
+
What is marked 0.5 is in the `next` prerelease until 0.5.0 is released: `npm i electron-cast@next`. `npm i
|
|
144
|
+
electron-cast` installs 0.4.0, which does not have it.
|
|
145
|
+
|
|
146
|
+
## Chrome parity
|
|
147
|
+
|
|
148
|
+
electron-cast does what Chrome does on the Presentation API path. Where it does not yet, or never will, this says so.
|
|
149
|
+
Rows marked "0.5, in `next`" are in the `next` prerelease (`npm i electron-cast@next`) until 0.5.0.
|
|
150
|
+
|
|
151
|
+
| Feature | Chrome | electron-cast | Notes |
|
|
152
|
+
|---|---|---|---|
|
|
153
|
+
| Google's Cast sender SDK on the page (`chrome.cast`, `cast.framework`) | Yes | Yes | Unmodified, over a stand-in Presentation API |
|
|
154
|
+
| Device discovery (mDNS `_googlecast._tcp`) | Yes | Yes | IPv4 on every interface, IPv6 link-local per adapter. IPv6 discovery verified on real devices |
|
|
155
|
+
| Devices listed once their channel is open and authenticated, kept open, retried, reopened after a failure | Yes | Yes | **0.5, in `next`.** Chrome's delays and backoff (`CastMediaSinkServiceImpl`); the list fills in a few seconds after `start()` |
|
|
156
|
+
| No channel to a publicly routable or loopback address | Yes (unless `MediaRouterCastAllowAllIPs`) | Yes (unless `sinks.allowAllIps`) | **0.5, in `next`.** Checked on the address a channel is opened to, when it is opened |
|
|
157
|
+
| Device picker | Chrome's dialog | Your UI through `selectDevice` | By design: the app owns the UI |
|
|
158
|
+
| Device authentication | Yes | Yes | A port of Chromium's checks, verified on real devices over IPv4, IPv6 unique-local and IPv6 link-local. One deliberate difference: a stale built-in fallback CRL skips revocation instead of refusing ([why](SECURITY.md#tls-and-device-authentication)) |
|
|
159
|
+
| App availability (`GET_APP_AVAILABILITY`) for a page's `getAvailability()` and the devices its `start()` offers | Yes | Yes | **0.5, in `next`.** Asked over the open channels, with Chrome's refresh rules. `mode: "chromecast"` still goes by capabilities |
|
|
160
|
+
| Start requires a user gesture | Checked in the browser process | Checked by the preload in the renderer | Electron has no main-process API for it ([SECURITY.md](SECURITY.md#user-gesture)) |
|
|
161
|
+
| Sessions: launch an app, app messages, media commands, volume, stop | Yes | Yes | |
|
|
162
|
+
| Auto-join after a reload (`origin_scoped`, `tab_and_origin_scoped`) | Yes | Yes | |
|
|
163
|
+
| Rejoin a session after the browser or app restarts, by id | Yes (`reconnect("cast-session_<id>")`) | Yes | The app stores the session id ([guide](docs/guides/restart-rejoin.md)); the session tracker knows which device runs it |
|
|
164
|
+
| Several windows | Yes | Yes | |
|
|
165
|
+
| Iframes (each frame is its own sender) | Yes | Yes | Needs `nodeIntegrationInSubFrames: true`. Unit tests only so far |
|
|
166
|
+
| Audio-only devices and speaker groups | Yes | Yes | Tested on a Google Home Mini and two groups |
|
|
167
|
+
| Observe sinks and routes, stop a route, set volume from the app | Internal | Yes ([MAIN-API](docs/MAIN-API.md)) | Modelled on `MediaRouter` |
|
|
168
|
+
| Media control of a route from the app (play, pause, seek, tracks, volume, media status) | Internal (`MediaController`) | Yes (`getMediaController`) | **0.5, in `next`.** Fed by the session tracker, as `CastMediaController` is; works on non-local routes too |
|
|
169
|
+
| Sessions started by other senders listed as routes (non-local routes), tracked live | Yes | Yes | **0.5, in `next`.** From each device's receiver status (`CastSessionTracker`). Unit tests only; not yet tried with a session another sender started on a real device |
|
|
170
|
+
| App-initiated casting through the page's default presentation request (`connectionavailable`) | Yes | Yes (`startCasting`) | **0.5, in `next`.** The app's menu or tray plays Chrome's Cast dialog ([MAIN-API](docs/MAIN-API.md#casting-from-the-apps-own-ui)). Unit tests and the smoke test only; not yet tried from an app's menu on a real device |
|
|
171
|
+
| Global Media Controls (the toolbar's media and Cast panel) | Browser UI | Out of scope: the app builds its own | Chrome's panel lists the routes and controls them ([`cast_media_notification_producer.cc`](https://github.com/chromium/chromium/blob/main/chrome/browser/ui/global_media_controls/cast_media_notification_producer.cc), [`cast_media_notification_item.cc`](https://github.com/chromium/chromium/blob/main/chrome/browser/ui/global_media_controls/cast_media_notification_item.cc)); the same calls are here: `registerMediaRoutesObserver` or `getRoutes`, `getMediaController`, `terminateRoute` |
|
|
172
|
+
| DIAL discovery and launch (`cast-dial:` sources from the SDK's `dialRequest`) | Yes | Yes | **0.5, in `next`.** SSDP, availability, the picker, launch and stop over HTTP ([DESIGN](docs/DESIGN.md#dial-srcdial)). A device that is also a Cast sink is listed as Cast only, as in Chrome; a DIAL-only device gets a Cast channel opened to port 8009 and is a Cast sink if that works, as in Chrome (`TryConnectDialDiscoveredSink`), and is left a DIAL sink after ten failed attempts. `dial: false` turns it off. DIAL discovery and device descriptions tested on real Chromecasts (1st gen, Ultra); launching an app over DIAL needs a DIAL-only TV and is untested |
|
|
173
|
+
| Tab and desktop mirroring | Yes | Yes (`mirroring` option, `startCasting` with `castMode`) | **0.5, in `next`.** A port of Chrome's Cast Streaming sender: VP8 and VP9, H.264 and the others in hardware where there is an encoder, and Opus, encryption, RTCP, retransmission and bitrate adaptation, on the device's one channel. The mirrored tab is muted locally, as in Chrome. Tested on a Chromecast Ultra (1080p, tab and desktop) and a Nest Hub Max (720p): at 720p frames reach the device in about 30 ms with none late; on the Ultra, video lag at 1080p is under investigation ([known issue](#known-issue-mirroring-video-lag-at-1080p)). On Windows, with the audio in sync; not tested on Linux or macOS. Desktop mirroring on macOS is untested on a real Mac; CI covers it with video only on Electron 40+. Tested on a Nest Hub Max: switching the mirrored tab (`switchMirroringSourceTab`: the same route, no new OFFER, about 30 fps after; the picture was not checked on screen), closing the mirrored tab (the route ends at once, the receiver app is gone within 3 s), H.264 in hardware (the Hub chose it: about 30 fps, 2.7 Mbps, about 4.4 ms per encode), `GET_CAPABILITIES` (the Hub answers error 10106 "Remoting is not supported" and mirroring goes on) and the statistics (`getMirroringStats`: Chrome's names, internally consistent; `AVG_E2E_LATENCY_MS` is 0 on the Hub, which sends no playout events). Also: freezing the picture (`freezeRoute`) works and keeps the session, also tested on a Nest Hub Max, but the Hub stopped acknowledging frames for about 9 s during a 15 s freeze and for 8 s after unfreezing (the sender matches Chrome; a Chrome control run is pending). The new offer after an encoder failure, letterboxing, and Chrome's encoder feedback (each frame's lossiness and utilization, and a tab capture size that follows them) are in, not yet tried on a real device. Not ported: remoting (it needs a hook Electron does not have) ([MAIN-API](docs/MAIN-API.md#tab-and-desktop-mirroring)) |
|
|
174
|
+
| File mirroring, and mirroring sources from a page's `PresentationRequest` | Yes | No | A page's mirroring sources are reported unavailable |
|
|
175
|
+
| Remote Playback API (`video.remote`) | Yes | Not done: needs Electron | Blink's `RemotePlayback` needs support in Electron; electron-cast reports `remote-playback:` sources unavailable |
|
|
176
|
+
| Wired display (presenting to a second monitor) | Yes | Yes (`wiredDisplay` option) | **0.5, in `next`.** A page's https (or localhost) `PresentationRequest` opens fullscreen in a sandboxed receiver window on the chosen screen; a request that also has a Cast URL gets one picker for both kinds ([DESIGN](docs/DESIGN.md#wired-displays)). Unit tests with fakes; tested on Windows on a second monitor (1080x1920, portrait) |
|
|
177
|
+
| Presentation Receiver API (`navigator.presentation.receiver` on the presented page) | Yes | Yes | **0.5, in `next`.** `connectionList`, `connectionavailable`, messages in both directions, `close`, `terminate` |
|
|
178
|
+
| Binary messages on a presentation connection (`ArrayBuffer`, `Blob`, `binaryType`) | Yes | Yes | **0.5, in `next`.** Carried to wired displays; dropped for Cast devices, as Chrome's Cast provider does |
|
|
179
|
+
| Access-code casting | Yes | Partly: adding the device by address (`addSinkByAddress`) | **0.5, in `next`.** Chrome's checks, open parameters, expiry and network-change handling are ported. Turning a typed code into an address is a private Google service behind Chrome's sign-in, so the app supplies the address and **must validate it**: private addresses and any port are allowed ([why](docs/DESIGN.md#access-code-casting-access-codets)). Unit tests only so far |
|
|
180
|
+
| `mode: "chromecast"`, a legacy `chrome.cast` polyfill | n/a | Frozen | Gets no new features; use the default mode ([notes](docs/FAQ.md#what-is-mode-chromecast)) |
|
|
181
|
+
|
|
182
|
+
## Platforms and what was tested
|
|
183
|
+
|
|
184
|
+
Say what was run, not what should work.
|
|
185
|
+
|
|
186
|
+
| | Discovery and device authentication | Casting end to end | Notes |
|
|
187
|
+
|---|---|---|---|
|
|
188
|
+
| Windows 11 | 8 real devices, all passed | Session, playback, restart rejoin and stop, on real devices, in an Electron 45 app (dev and packaged builds). Tab mirroring (1080p30, VP8 and Opus in software) and desktop mirroring (picture and system audio) to a Chromecast Ultra | The devices: Chromecast, Chromecast Ultra, Google Home Mini (audio-only), Nest Hub, Nest Hub Max and two Cast groups |
|
|
189
|
+
| Linux | All 8 devices passed on 2026-11-25 (Ubuntu under WSL2 with mirrored networking) | Session, playback, rejoin after a force-kill and stop, on real devices, in an Electron 45 app (Ubuntu under WSL2, dev and packaged builds) | |
|
|
190
|
+
| macOS | Not tested | Not tested | CI loads the package in a real Electron on macOS with a fake device and no real network. Desktop mirroring on macOS is untested on a real Mac; CI covers it with video only on Electron 40+. |
|
|
191
|
+
|
|
192
|
+
The end-to-end runs were an Electron 45 app loading YouTube Music, casting to speaker groups, a Nest Hub and several
|
|
193
|
+
Chromecasts, and `cast.framework` on a Nest Hub: session start, volume, HLS load, play, pause, seek, resume and stop.
|
|
194
|
+
|
|
195
|
+
Electron: the CI smoke test loads the built package in a real Electron 35, 40 and the latest stable on Linux, Windows
|
|
196
|
+
and macOS. Its network is faked: no real device. Real-device runs used Electron 45. Electron 35 is the oldest supported
|
|
197
|
+
(the preload needs `contextBridge.executeInMainWorld`). Node 20 or later.
|
|
198
|
+
|
|
199
|
+
IPv6 discovery, and the Cast channel with TLS and device authentication over IPv6 unique-local (ULA) and link-local
|
|
200
|
+
addresses, were verified on real devices. Iframes are covered by unit tests only; the smoke test does not load an iframe.
|
|
201
|
+
|
|
202
|
+
<details>
|
|
203
|
+
<summary><b>From the site</b>: the parity table and the replay at rest</summary>
|
|
204
|
+
<br>
|
|
205
|
+
<div align="center">
|
|
206
|
+
<img src="docs/readme/parity.jpg" width="100%" alt="The 'As Chrome does it' table from the front page: each row names a rule, what Chrome does, what electron-cast does, and the Chromium source file it is tied to, with the first row open.">
|
|
207
|
+
<br><br>
|
|
208
|
+
<img src="docs/readme/nosignal.jpg" width="100%" alt="The recorded-session replay before it starts: a greyscale test card with a NO SIGNAL plate, play, back, step and reset controls and a scrub bar.">
|
|
209
|
+
</div>
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
## Test a DIAL TV
|
|
213
|
+
|
|
214
|
+
The `dial-test` command and DIAL support are new in 0.5, so the command runs the `next` prerelease. DIAL discovery and device descriptions have been tested on real Chromecasts (1st gen, Ultra); launching an app over DIAL
|
|
215
|
+
needs a DIAL-only TV and is untested. If you have a TV or stick that offers DIAL but not Chromecast
|
|
216
|
+
(many Roku, Samsung, LG, Sony and Fire TV models), you can help with one command and a few y/n answers. You need Node 20 or
|
|
217
|
+
later; you do not need Electron or the library installed.
|
|
156
218
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
Electron's ESM startup, not electron-cast. Use `app.whenReady().then(...)` or put the work in a function that is not
|
|
160
|
-
awaited at the top level:
|
|
161
|
-
|
|
162
|
-
```js
|
|
163
|
-
app.whenReady().then(async () => {
|
|
164
|
-
await cast.start();
|
|
165
|
-
// create windows
|
|
166
|
-
});
|
|
219
|
+
```sh
|
|
220
|
+
npx electron-cast@next dial-test
|
|
167
221
|
```
|
|
168
222
|
|
|
169
|
-
|
|
170
|
-
there describes the top-level await form of the same hang).
|
|
171
|
-
|
|
172
|
-
## What works
|
|
223
|
+
(From a checkout of this repository: `npm ci && npm run build && node dist/cli.js dial-test`.)
|
|
173
224
|
|
|
174
|
-
|
|
175
|
-
coming and going live. A network that goes away takes its devices with it, and discovery recovers after the machine
|
|
176
|
-
wakes from sleep.
|
|
177
|
-
- Devices are verified as genuine Google-certified Cast devices, as Chrome does (on by default, see above).
|
|
178
|
-
- Several pages or windows at once, and iframes (with `nodeIntegrationInSubFrames`). A page that reloads keeps its
|
|
179
|
-
sessions open on the device and rejoins them (auto-join, `origin_scoped` or `tab_and_origin_scoped`). A page that
|
|
180
|
-
closes leaves its sessions without stopping playback. After an app restart a page rejoins a session by id (above).
|
|
181
|
-
- A main-process API modelled on Chrome's Media Router: observe devices and sessions, stop or detach a session, set
|
|
182
|
-
its volume, and keep a picker up to date while it is open ([docs/MAIN-API.md](docs/MAIN-API.md)).
|
|
225
|
+
What it does, in order:
|
|
183
226
|
|
|
184
|
-
|
|
227
|
+
1. Looks for DIAL devices for about 10 seconds with the library's own discovery, on every network interface, and lists
|
|
228
|
+
them by manufacturer and model.
|
|
229
|
+
2. Reads the device description and the app info of YouTube and Netflix, and opens one TLS connection to port 8009 and
|
|
230
|
+
closes it at once (no Cast message is sent). Nothing on the TV changes.
|
|
231
|
+
3. **Asks** "Open YouTube on your TV?". Only if you answer yes does it start YouTube with the library's own launch request,
|
|
232
|
+
ask whether it appeared, stop it again (if the TV allows that) and ask whether it closed. Ctrl-C at any point stops
|
|
233
|
+
what it opened. `--read-only` never opens anything.
|
|
234
|
+
4. Prints a report, saves it as `dial-test-report.md` in the current folder, and prints a link that opens a prefilled
|
|
235
|
+
GitHub issue. Names, serial numbers, UUIDs, MAC addresses, IP addresses and URL hosts are replaced, and the values
|
|
236
|
+
under the app info's `additionalData` are removed. **Read the report before you post it.**
|
|
185
237
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
and several Chromecasts, and with `cast.framework` on a Nest Hub: session start, volume, HLS load, play, pause,
|
|
190
|
-
seek, resume and stop.
|
|
238
|
+
If no device is found it says why that usually happens (a different network or VLAN, a firewall blocking UDP, a VPN) and
|
|
239
|
+
still writes a report, which is useful too. Options: `--device N`, `--yes`, `--read-only`, `--seconds N`, `--out FILE`
|
|
240
|
+
(`npx electron-cast@next dial-test --help`).
|
|
191
241
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- `chrome.cast.initialize`, `requestSession`, `session.stop`, `session.leave`, receiver availability, volume and
|
|
195
|
-
mute, and messages on custom namespaces (`sendMessage` and `addMessageListener`).
|
|
196
|
-
- `chrome.cast.media`: load and queue media (`loadMedia`, `queueLoad`), control playback (play, pause, seek, stop,
|
|
197
|
-
volume, tracks, queue operations), receive media status updates, and watch for media with media listeners.
|
|
198
|
-
- `cast.framework` (`CastContext`, `RemotePlayer`, `RemotePlayerController`) on top of the polyfill. Google's
|
|
199
|
-
loader scripts are blocked so they can't overwrite it.
|
|
200
|
-
- Tested end to end with a Chromecast (YouTube Music), and with `cast.framework` media on a Nest Hub (load, play,
|
|
201
|
-
pause, seek, volume, and stopping from the picker).
|
|
242
|
+
## Staying compatible with Google's SDK
|
|
202
243
|
|
|
203
|
-
|
|
244
|
+
The page runs Google's SDK, which Google can change per Chrome major without an electron-cast release. `npm run canary`
|
|
245
|
+
(also a weekly GitHub Actions job) downloads the SDK for Chrome stable, beta and dev and for the Chromium that
|
|
246
|
+
Electron 45 ships, and checks as text, without running it, that it still uses the message types, fields, request
|
|
247
|
+
types and presentation URLs electron-cast translates. See [CONTRIBUTING.md](CONTRIBUTING.md#the-sdk-canary).
|
|
204
248
|
|
|
205
|
-
##
|
|
249
|
+
## Known issue: mirroring video lag at 1080p
|
|
206
250
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
fields, request types and presentation URLs electron-cast translates. A missing one fails; a new message type is a
|
|
211
|
-
warning. `tools/sdk-canary-baseline.json` records what the SDK looked like when it last worked; refresh it with
|
|
212
|
-
`node tools/sdk-canary.mjs --update-baseline`. Options: `--majors 158,159`, `--electron <major>|none`.
|
|
251
|
+
Mirroring was tested on a Chromecast Ultra (1080p, tab and desktop) and a Nest Hub Max (720p): at 720p frames reach the
|
|
252
|
+
device in about 30 ms with none late; on the Ultra, video lag at 1080p is under investigation. The audio stays in sync.
|
|
253
|
+
Mirroring is in the `next` prerelease (`npm i electron-cast@next`) until 0.5.0.
|
|
213
254
|
|
|
214
|
-
##
|
|
255
|
+
## Known issue: top-level `await app.whenReady()` on Electron 45
|
|
215
256
|
|
|
216
|
-
|
|
257
|
+
In an ES module main process, a top-level `await app.whenReady()` never resolves on Electron 45 (reproduced on 45.5.0
|
|
258
|
+
on Windows). It is Electron's ESM startup, not electron-cast. Use `app.whenReady().then(...)`, as above.
|
|
259
|
+
[Details](docs/TROUBLESHOOTING.md#the-app-hangs-at-top-level-await-appwhenready-electron-45).
|
|
217
260
|
|
|
218
|
-
|
|
219
|
-
- `CastClient`: a Cast v2 connection over TLS (device authentication, connect, heartbeat, launch, stop, volume, app
|
|
220
|
-
messages).
|
|
221
|
-
- `CastSessionService`: the session logic behind the Electron layer, with no Electron dependency.
|
|
261
|
+
## Documentation
|
|
222
262
|
|
|
223
|
-
|
|
263
|
+
| | |
|
|
264
|
+
|---|---|
|
|
265
|
+
| [Getting started](docs/GETTING-STARTED.md) | Main, preload, sandboxing, CSP, iframes, packaging per OS |
|
|
266
|
+
| [Guides](docs/guides/index.md) | Recipes: picker, restart rejoin, windows and iframes, custom receivers, audio devices, device authentication, low-level client, testing |
|
|
267
|
+
| [Troubleshooting](docs/TROUBLESHOOTING.md) and [FAQ](docs/FAQ.md) | No devices, auth failures, hangs, dropped sessions, with commands |
|
|
268
|
+
| [API reference](docs/API.md) and [main-process API](docs/MAIN-API.md) | Every export |
|
|
269
|
+
| [Architecture](docs/ARCHITECTURE.md), [design](docs/DESIGN.md), [Chromium map](docs/CHROMIUM-MAP.md) | How it works and which Chromium code it mirrors |
|
|
270
|
+
| [Security](SECURITY.md) | Threat model, what crosses IPC, how to report a vulnerability |
|
|
271
|
+
| [Contributing](CONTRIBUTING.md) | Setup, tests, the Chrome rule, releases |
|
|
224
272
|
|
|
225
|
-
|
|
226
|
-
More docs: [API reference](docs/API.md), [security notes](SECURITY.md), [changelog](CHANGELOG.md) and a
|
|
227
|
-
[runnable example app](examples/electron-app).
|
|
273
|
+
<div align="center"><img src="docs/readme/board.jpg" width="100%" alt="The electron-cast brand board: the mark, a square-cornered c with a red square in its opening, on paper and on ink; the palette of ink, paper, tally red, graphite and rule; Archivo and Commit Mono type; lockups; and icon sizes from 512 down to 16 pixels."></div>
|
|
228
274
|
|
|
229
275
|
## License
|
|
230
276
|
|