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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,285 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0-next.1 (prerelease)
|
|
4
|
+
|
|
5
|
+
A prerelease of 0.5.0 on the npm `next` tag: install it with `npm i electron-cast@next` (`npm i electron-cast`
|
|
6
|
+
still installs 0.4.0).
|
|
7
|
+
|
|
8
|
+
This release brings electron-cast's main process in line with Chrome's Media Router: devices are tracked over kept-open
|
|
9
|
+
channels, the sessions on them are followed whoever started them, the app can cast and control media from its own
|
|
10
|
+
UI, DIAL devices are found and cast to next to Cast devices, a page can present on another screen (a wired
|
|
11
|
+
display) with the Presentation Receiver API on the other end, and the app can mirror a tab or the desktop. Each rule names the Chromium code it follows ([docs/CHROMIUM-MAP.md](docs/CHROMIUM-MAP.md)). `mode: "chromecast"`
|
|
12
|
+
is frozen and behaves as before for pages; it shares the device list.
|
|
13
|
+
|
|
14
|
+
### Highlights
|
|
15
|
+
|
|
16
|
+
- **Tab and desktop mirroring, tested on a Chromecast Ultra and a Nest Hub Max.** `createCastManager({ mirroring })` enables
|
|
17
|
+
`startCasting(sinkId, { castMode: "tab_mirror", webContentsId })` and
|
|
18
|
+
`startCasting(sinkId, { castMode: "desktop_mirror", desktopSourceId, withAudio })` in the main process, Chrome's `TAB_MIRROR` and `DESKTOP_MIRROR` cast modes, with `castMode` and `withAudio` filters on
|
|
19
|
+
`registerMediaSinksObserver`. `startCasting` is one method for the three modes (`StartCastingOptions`, a union on
|
|
20
|
+
`castMode`; `MediaCastMode` gains the two mirroring modes). It is a TypeScript port of Chrome's Cast Streaming sender
|
|
21
|
+
(openscreen's sender session, Chromium's frame sender policy and Mirroring Service host, and the MirroringActivity
|
|
22
|
+
routing): OFFER/ANSWER, VP8, VP9, H.264 in hardware and Opus, AES encryption, RTCP, NACK retransmission and bitrate adaptation.
|
|
23
|
+
The video encoder is set up as Chrome's `MediaVideoEncoderWrapper` sets it up (a constant bitrate, the screen content
|
|
24
|
+
hint), and frame drops are logged by reason.
|
|
25
|
+
Capture and WebCodecs encoding run in a hidden window; the sender runs in a utility process per route; the session
|
|
26
|
+
runs on the device's one kept-open channel. A mirrored tab is muted locally while it is cast (Chrome's muter);
|
|
27
|
+
desktop audio follows Chrome per platform (local playback keeps going on Windows, `kCastDesktopMirroringKeepLocalAudio`,
|
|
28
|
+
and is muted elsewhere). No new dependencies. Tested on Windows to a Chromecast Ultra (1080p, tab and desktop) and a
|
|
29
|
+
Nest Hub Max (720p): at 720p frames reach the device in about 30 ms with none late; on the Ultra, video lag at 1080p
|
|
30
|
+
is under investigation. Tab mirroring sends Opus and VP8 in software, with the audio in sync and only on the TV;
|
|
31
|
+
desktop mirroring sends the picture and system audio and keeps local audio on Windows. 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+. Not ported: remoting (Electron has no hook
|
|
32
|
+
for it, see [DESIGN.md](docs/DESIGN.md#media-remoting-capabilities-only-the-renderer-side-is-not-reachable)). Like Chrome, a mirroring session sends `GET_CAPABILITIES`
|
|
33
|
+
once after the first negotiation and keeps the receiver's remoting capabilities. Tested on a Nest Hub Max: it answers
|
|
34
|
+
error 10106 "Remoting is not supported" and mirroring goes on.
|
|
35
|
+
- **Wired displays, as Chrome's `WiredDisplayMediaRouteProvider` has them, tested on a second monitor** (Windows, a
|
|
36
|
+
1080x1920 portrait display). New `wiredDisplay` option on `createCastManager` (presentation mode): other screens are presentation sinks (`wired_display_<id>`, "Display N"). A
|
|
37
|
+
`PresentationRequest` whose URL is https (not the legacy Cast URL) or http on localhost can start on a display: the
|
|
38
|
+
page opens fullscreen in a receiver window that has its own in-memory session (cleared and reused, not one per
|
|
39
|
+
presentation), no menu or developer tools, no permissions except fullscreen, and ends the presentation if it
|
|
40
|
+
navigates away. The receiver is sandboxed as Chrome's is (`kPresentationReceiverSandboxFlags`: no modals, popups or
|
|
41
|
+
top-level navigation) by a `Content-Security-Policy: sandbox` header on every receiver document, so an iframe's
|
|
42
|
+
`alert()` is refused too. A display connection starts `connecting` and becomes `connected` when the receiver page is
|
|
43
|
+
ready, as Blink's does.
|
|
44
|
+
- The receiver page gets `navigator.presentation.receiver` (`connectionList`, `connectionavailable`, `send`, `close`,
|
|
45
|
+
`terminate`), and the controller can `reconnect(id)`. Closing the window, removing the display or `terminate()`
|
|
46
|
+
ends the presentation for every controller; a controller that goes away only leaves it.
|
|
47
|
+
- The display a page is on is left out of the picker by default, found with the new `BrowserWindow` option and
|
|
48
|
+
`screen.getDisplayMatching`, and `request.observeSinks` follows the window as it moves (`displayOf` overrides it).
|
|
49
|
+
- A request that lists both a Cast (or `cast-dial:`) URL and a page URL is one picker, as Chrome's dialog lists both
|
|
50
|
+
kinds of sink: `selectDevice` gets `request.displays` and may answer `{ display }` (new type `DisplayChoice`), and the
|
|
51
|
+
request starts on the sink it returns. Its `getAvailability()` is true when either kind has a sink.
|
|
52
|
+
- New exports: `createReceiverWindows` (the Electron `BrowserWindow` part, taking `BrowserWindow`, `session`,
|
|
53
|
+
`ipcMain` and a folder for the generated receiver preload; calling it twice on one `ipcMain` and channel throws),
|
|
54
|
+
the display rules (`isWiredDisplaySource`, `availableDisplays`, `wiredDisplaySinks`), and `manager.wiredDisplay`
|
|
55
|
+
(sinks and routes observers, `terminateRoute`). `mode: "chromecast"` is unchanged.
|
|
56
|
+
- **DIAL, as Chrome's Media Router does it (presentation mode).** DIAL discovery and device descriptions are tested on
|
|
57
|
+
real Chromecasts (1st gen, Ultra); launching an app over DIAL needs a DIAL-only TV and is untested. electron-cast now
|
|
58
|
+
discovers DIAL devices by SSDP and
|
|
59
|
+
serves the `cast-dial:` sources that Google's SDK adds to a request when the page passes a `dialRequest`
|
|
60
|
+
(`chrome.cast.DialRequest`, as YouTube's web app does for non-Cast TVs). Each rule follows a Chromium function,
|
|
61
|
+
cited in [docs/DESIGN.md](docs/DESIGN.md#dial-srcdial): an M-SEARCH on every IPv4 interface (four searches a second
|
|
62
|
+
apart, every 120 s), the UPnP device description and the `Application-URL` header (both only for private addresses
|
|
63
|
+
that equal the sender's), app info for the app a page asks about, and a sink per device. A page sees availability
|
|
64
|
+
per app (only to the origins Chrome allows for that app) through the same observation as its Cast URL, the picker
|
|
65
|
+
offers DIAL sinks that have the app next to the Cast devices that have theirs, and starting one runs the SDK's
|
|
66
|
+
`custom_dial_launch` round trip, an HTTP launch with the SDK's launch parameter, and a stop by `DELETE` of the run
|
|
67
|
+
URL. A device that is also a Cast sink (its UDN is the Cast id, and its channel is open) is shown as a Cast device
|
|
68
|
+
only, as in Chrome. On by default, as in Chrome; `dial: false` on `createCastManager` turns it off (SSDP and the
|
|
69
|
+
HTTP requests to devices stop entirely). A custom `discovery` turns it off unless `dial` is given.
|
|
70
|
+
- A DIAL sink that is a Cast sink too is removed, as Chrome removes it, and only DIAL discovery adds it back (not
|
|
71
|
+
the Cast sink going away).
|
|
72
|
+
- Differences from Chrome: requests have timeouts (Chrome sets none). A DIAL route has no volume or media control,
|
|
73
|
+
as in Chrome (`BindMediaController` is not implemented there).
|
|
74
|
+
- **A DIAL device is tried as a Cast device**, as Chrome's `CastMediaSinkServiceImpl` does
|
|
75
|
+
(`OnSinkAddedOrUpdated`, `TryConnectDialDiscoveredSink`, `CreateCastSinkFromDialSink`): when a DIAL sink is new or
|
|
76
|
+
changed, and on `discoverSinksNow()`, a Cast channel is opened to its address on port 8009. If it opens and the device
|
|
77
|
+
authenticates, the device is a Cast sink (id the sink's UUID, its friendly name and model, audio and video, or audio
|
|
78
|
+
only for an audio-only certificate) and the DIAL sink is removed, as above. It is skipped when a Cast sink has that id or that
|
|
79
|
+
address. Every failed attempt is counted per device; at ten (`kMaxDialSinkFailureCount`) the device is taken for a
|
|
80
|
+
non-Cast device and not tried again, until it is opened from mDNS or the network changes.
|
|
81
|
+
- DIAL discovery errors (no interface, a socket that fails to bind or send) are logged through `dial.log` and never
|
|
82
|
+
thrown; `start()` works with no network. Nothing is asked of a device for an app the page's origin may not see,
|
|
83
|
+
the monitored apps are bounded, stopping aborts requests in flight (a route terminated mid-launch cancels its
|
|
84
|
+
POST), and a `start()` without an earlier availability watch waits (up to 5 s) for the devices' app answers.
|
|
85
|
+
- API: `MediaSink` and `MediaRoute` gain `providerId` (`"cast"` or `"dial"`), `SinkIconType` gains `"generic"`, and
|
|
86
|
+
`CastDevice` gains an optional `dial` field that marks a DIAL sink. The sinks observer without a query also
|
|
87
|
+
reports DIAL sinks (they have no capabilities, so a `capabilities` query never does, and a `presentationUrls` query
|
|
88
|
+
matches them for its `cast-dial:` URLs); `manager.devices()` still lists Cast devices only. `selectDevice` can be handed a DIAL
|
|
89
|
+
device when the request carries a `cast-dial:` URL: return it like any other and the manager does the rest (do not
|
|
90
|
+
connect to it yourself). `getMediaController` on a DIAL route throws `route_not_found`. The SDK canary no longer
|
|
91
|
+
lists the DIAL messages and `cast-dial:` as unhandled.
|
|
92
|
+
- New options and methods for the device list: `sinks` (`openDelayMaxMs`, `reportDelayMs`, `retry`, `allowAllIps`,
|
|
93
|
+
`dynamicTimeoutDeltaMs`) on `createCastManager` and `CastSessionService`, each a Chrome setting (there is no cap or
|
|
94
|
+
off switch, because Chrome has none); `CastManager.discoverSinksNow()` and `CastManager.settled()` (with
|
|
95
|
+
`{ retries: true }`); the type `ChannelParams`.
|
|
96
|
+
- `isPubliclyRoutable`, `isLoopback`, `isCastAddressAllowed` and `parseIpBytes` are exported from the discovery layer
|
|
97
|
+
(ports of `net::IPAddress`). `APP_AVAILABILITY_REFRESH_MS` is exported.
|
|
98
|
+
- **Access code casting: devices can be added by address, as Chrome's access code casting adds the device a code
|
|
99
|
+
resolves to.** `manager.addSinkByAddress({ id, name, capabilities, ipV4Address, port })` opens a channel to a device the app knows the
|
|
100
|
+
address of, lists it like a discovered one (the picker, availability for pages, the sinks observers) and remembers it,
|
|
101
|
+
with Chrome's checks, quick open parameters (2 s connect, 3 attempts 1 s apart) and expiry: it stays for
|
|
102
|
+
`accessCode.deviceDuration` seconds (default 0) plus 20 s, a device a page is casting to stays until the cast ends, and a
|
|
103
|
+
network change removes it and brings the remembered ones back. It is off
|
|
104
|
+
unless `createCastManager({ accessCode: { enabled: true } })`, as Chrome's `AccessCodeCastEnabled` policy is. Turning a
|
|
105
|
+
typed code into an address is a private Google service that needs Chrome's sign-in, so it is not part of electron-cast;
|
|
106
|
+
[DESIGN.md](docs/DESIGN.md#access-code-casting-access-codets) says why. The address comes from the app, not from
|
|
107
|
+
Google's server as in Chrome, so validate what users type: Chrome's rules allow any private address and port. New: `addSinkByAddress`, `configureAccessCode`,
|
|
108
|
+
`rememberedSinks`, `createAccessCodeSink`, the `accessCode` option (with `store` to keep devices
|
|
109
|
+
between runs), and `pingIntervalMs` in `createClient`'s second argument.
|
|
110
|
+
- **`electron-cast dial-test`, a one-command test for DIAL TVs** (`npx electron-cast@next dial-test`; Node 20 or later, no
|
|
111
|
+
Electron), run on a real network: it found three Chromecasts over DIAL and flagged them as Cast devices. It runs the
|
|
112
|
+
library's own DIAL discovery, device description, app info, launch and stop against a real device, asks before it opens YouTube on it, and writes a Markdown report with names, serial numbers, UUIDs, MAC addresses,
|
|
113
|
+
IP addresses and URL hosts removed, plus a prefilled GitHub issue link. The package gains a `bin` entry
|
|
114
|
+
(`electron-cast` -> `dist/cli.js`). See the README's "Test a DIAL TV".
|
|
115
|
+
|
|
116
|
+
Not yet tried on real devices: casting from the app's own UI (`startCasting` from its menu) and the sessions that other
|
|
117
|
+
senders started. Both are covered by unit tests with fakes.
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
|
|
121
|
+
- **A session tracker follows what every device runs**, from the receiver status and media status on the device's
|
|
122
|
+
channel, whoever started it (Chrome's `CastSessionTracker`). Sessions started elsewhere, or by this app before it
|
|
123
|
+
restarted, are reported through the routes observers and `getRoutes()` as non-local routes, as Chrome does;
|
|
124
|
+
`MediaRoute` gains `isLocal` and `sinkName`, and `origin` is empty on a non-local route. A non-local route can be
|
|
125
|
+
terminated and have its volume set.
|
|
126
|
+
- **Media control from the main process.** `manager.getMediaController(routeId, observer?)` is Chrome's
|
|
127
|
+
`MediaController` and `MediaStatusObserver` for a route: `play`, `pause`, `seek`, `nextTrack`, `previousTrack`,
|
|
128
|
+
`setVolume`, `setMute`, and the media status (title, play state, position, duration, volume, what the media can do,
|
|
129
|
+
images). It works on non-local routes too. Its status comes from the session tracker, as `CastMediaController`'s does:
|
|
130
|
+
every receiver status and every `MEDIA_STATUS` reaches every observer, changed or not, with media updates merged
|
|
131
|
+
into what was known and the `supportedMediaCommands` mask turned into a list. Binding sends the session's state
|
|
132
|
+
first and then `MEDIA_GET_STATUS`. New types `MediaController`, `MediaStatus`, `MediaStatusObserver`, `MediaImage`
|
|
133
|
+
and `MediaPlayState`. See docs/MAIN-API.md.
|
|
134
|
+
- **Casting from the app's own UI, on the page's default request.** In Chrome a page sets
|
|
135
|
+
`navigator.presentation.defaultRequest = new PresentationRequest(urls)`; the Cast dialog, opened from the browser's
|
|
136
|
+
menu or toolbar, offers it as a source, and when the user picks a device Chrome starts the presentation and fires
|
|
137
|
+
`connectionavailable` on the default request, which Google's Cast SDK adopts. electron-cast now does the same:
|
|
138
|
+
- The page-side stand-in reports `navigator.presentation.defaultRequest` (set, replaced, cleared) to the main
|
|
139
|
+
process, and only the window's main frame counts. A navigation or a destroyed window clears it.
|
|
140
|
+
- New `CastManager` methods, named after Chrome's `WebContentsPresentationManager` and `MediaRouterUI`:
|
|
141
|
+
`hasDefaultPresentationRequest(webContentsId)`, `getDefaultPresentationRequest(webContentsId)`,
|
|
142
|
+
`addPresentationObserver(webContentsId, observer)` and `startCasting(sinkId, { webContentsId })`, which starts the
|
|
143
|
+
default request on a sink with no picker and no user gesture. The page gets `connectionavailable` with a working
|
|
144
|
+
connection and the route appears in routes observers. It rejects with `MediaRouteError` carrying Chrome's
|
|
145
|
+
`RouteRequestResultCode` (`timed_out`, `sink_not_found`, `invalid_origin`, `cancelled`, `redundant_request`,
|
|
146
|
+
`unknown_error`) or `unable_to_cast`. `startCasting` launches anew on a sink that already has a route, stops the
|
|
147
|
+
route its window launched before, and uses the URL's `__castLaunchTimeout__` or 60 s, all as Chrome's
|
|
148
|
+
`CastActivityManager` does. New types `PresentationRequest`, `PresentationObserver` and `MediaCastMode`.
|
|
149
|
+
- `MediaSinksQuery` gains `presentationUrls`, the sinks that can run a presentation URL: as in Chrome, the device
|
|
150
|
+
must say the app is available (`GET_APP_AVAILABILITY`) and have its capabilities. A DIAL sink matches a
|
|
151
|
+
`cast-dial:` URL whose app it has, for the query's new `origin`, and `startCasting` starts a DIAL route on it, as
|
|
152
|
+
Chrome's dialog offers DIAL sinks for a default request's `cast-dial:` URLs.
|
|
153
|
+
- **Switch the mirrored tab, freeze the picture.** `switchMirroringSourceTab(routeId, webContentsId)` moves a
|
|
154
|
+
`tab_mirror` route to another page without ending or renegotiating the session (Chrome's "share this tab instead":
|
|
155
|
+
capture and the audio stream restart on the new page, encoders and timelines carry on, local muting moves to the new
|
|
156
|
+
page, and a second route on the same page ends). `freezeRoute` / `unfreezeRoute` pause and resume the video on its last
|
|
157
|
+
frame as Chrome's freeze does (audio goes on, 500 ms delay), and mirroring routes report `freezeInfo` (`canFreeze`,
|
|
158
|
+
`isFrozen`). Tested on a Nest Hub Max: a switch keeps the same route with no new OFFER and runs at about 30 fps after (the
|
|
159
|
+
picture was not checked on screen); freezing the picture works and keeps the session, 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).
|
|
160
|
+
- **One route per page, and a closed tab ends its mirroring.** As in Chrome, a page that becomes a mirroring source
|
|
161
|
+
(a launch or a switch) loses the Cast SDK / Presentation API sessions it launched, and a page that launches one
|
|
162
|
+
loses its mirroring routes (`CastActivityManager::routes_by_frame_`). Closing the page being mirrored ends a tab route
|
|
163
|
+
(`CastMirroringServiceHost::WebContentsDestroyed`); a desktop route is unaffected. Tested on a Nest Hub Max: closing the
|
|
164
|
+
mirrored tab ends the route at once, and the receiver app is gone within 3 s.
|
|
165
|
+
- **Mirroring statistics.** A debugging aid with Chrome's names and units, like `chrome://media-router-internals`
|
|
166
|
+
"Mirroring stats": `setMirroringStatsEnabled(true)` before `startCasting`, then `getMirroringStats(routeId)` and
|
|
167
|
+
`registerMirroringStatsObserver` (every 500 ms) give `{ audio, video }` with `ENQUEUE_FPS`, the latency averages and
|
|
168
|
+
histograms, bitrates, packet counts and the sender's own counters. A port of openscreen's statistics collector,
|
|
169
|
+
clock offset estimator and analyzer, with the receiver's RTCP event log parsed. Off by default; nothing is uploaded
|
|
170
|
+
(Chrome's UMA is not ported). `examples/live-mirroring` takes `--stats`. `getMirroringStats` never throws, as
|
|
171
|
+
Chrome's `MediaRouterDebuggerImpl::GetMirroringStats` has no error path: `{}` while off and for an unknown route, and an
|
|
172
|
+
ended route keeps its last statistics until another route pushes. Tested on a Nest Hub Max: Chrome's names, internally
|
|
173
|
+
consistent; `AVG_E2E_LATENCY_MS` is 0 on the Hub, which sends no playout events.
|
|
174
|
+
- **Mirroring uses a hardware encoder when there is one, as Chrome does.** The capture page asks WebCodecs
|
|
175
|
+
(`prefer-hardware`) which of H.264, VP8 and VP9 a hardware encoder takes, and offers those hardware-first (H.264 as
|
|
176
|
+
Annex B); VP8 in software is offered only when no hardware codec is, or when the receiver takes none of the hardware
|
|
177
|
+
ones. A hardware encoder that fails mid-session no longer stops mirroring: the codec is dropped for the rest of the
|
|
178
|
+
app's run and the session negotiates again. Chrome's `--cast-streaming-force-{enable,disable}-hardware-<codec>` and
|
|
179
|
+
`--disable-cast-letterboxing` switches, and the `CastStreamingVp8` / `Vp9` / `Av1` / `HardwareHevc` / `Win|MacHardwareH264`
|
|
180
|
+
features of `--enable-features` / `--disable-features`, are honoured, read from `app.commandLine` (so switches the app
|
|
181
|
+
appends count) when the `electron` object passed as `mirroring.electron` includes `app`. Tested on a Nest Hub Max: the
|
|
182
|
+
Hub chose H.264 in hardware, about 30 fps at 2.7 Mbps, with about 4.4 ms per encode.
|
|
183
|
+
- **VP9 is offered by default, as in Chrome.** In hardware when an encoder takes it, in software under the same
|
|
184
|
+
hardware-first rule as VP8; there is no option for it.
|
|
185
|
+
- **Mirroring letterboxes like Chrome.** The capture now asks for the `fixed_aspect_ratio` policy when the receiver
|
|
186
|
+
cannot scale (always for a Nest Hub): frames keep a 16:9 shape whatever the page or screen looks like, and a tab is
|
|
187
|
+
no longer upscaled to 1920x1080. The new offer after an encoder failure and the letterboxing are tested
|
|
188
|
+
against the fake receiver and in the smoke test; not yet on a real device (H.264 in hardware is, above).
|
|
189
|
+
- **Mirroring adapts to encoder load as Chrome does.** Each encoded frame now carries Chrome's encoder utilization
|
|
190
|
+
(smoothed, clamped) and lossiness, estimated from the frame's pixels because WebCodecs reports no quantizer (a port of
|
|
191
|
+
`FrameComplexityEstimator`). `VideoSender` feeds the larger of the two back, and for a tab the capture size follows it
|
|
192
|
+
like Chrome's `VideoCaptureOracle`: it steps down when the encoder or the link is overloaded and back up when there is
|
|
193
|
+
room, within the limits of the resolution change policy. Screens are captured at the full size, as in Chrome.
|
|
194
|
+
Switching the tab starts the size over, as a new capture device does in Chrome. The `LOSSINESS` statistic now reads
|
|
195
|
+
each frame's value; it is -100, as in Chrome, until a frame has reported one. Not yet tried on a real device.
|
|
196
|
+
- **Mirrored frames carry their capture time, and the capture rate is limited as Chrome limits it.** A frame's
|
|
197
|
+
reference time is its capture time from the frame metadata when the source gives one (else the capture timestamp
|
|
198
|
+
moved onto the wall clock by the smallest delay seen), so uneven delivery no longer skews the receiver's playout.
|
|
199
|
+
Each frame carries its capture begin and end times to the sender, which logs them as `FRAME_CAPTURE_BEGIN` and
|
|
200
|
+
`FRAME_CAPTURE_END`, so the capture, encode and end-to-end latency statistics start at capture. The capture is thinned
|
|
201
|
+
to the session's frame rate by a port of Chrome's `SmoothEventSampler` (a token bucket of 1.5 frame periods, judged
|
|
202
|
+
on capture timestamps), so a burst after a stall is kept whole. The sender logs its pipeline stages, the router's
|
|
203
|
+
bursts and the frame sizes, and `smoke/perf.mjs` mirrors a 1080p page to the fake receiver to measure them. Checked
|
|
204
|
+
on a Nest Hub Max: a steady 30 fps, 1.1% of the video frames dropped, no audio dropped.
|
|
205
|
+
- **The manager follows network changes by itself, as Chrome's `DiscoveryNetworkMonitor` tells its media router.** It
|
|
206
|
+
computes Chrome's network id from the connected interfaces and, when it changes, does what Chrome's two observers do:
|
|
207
|
+
DIAL devices given up on as non-Cast are tried again, the sinks of the network being left are remembered and reopened
|
|
208
|
+
on coming back to it (`CastMediaSinkServiceImpl::OnNetworksChanged`), and devices added by address with no route are
|
|
209
|
+
removed and the remembered ones added back 4.45 s later (`AccessCodeCastSinkService::OnNetworksChanged`). DIAL
|
|
210
|
+
discovery forgets its devices and searches again at once instead of waiting up to 120 s, and does not search while
|
|
211
|
+
there is no network (`DialRegistry::OnConnectionChanged`). Node has no
|
|
212
|
+
network-change event, so it reads `os.networkInterfaces()` every 5 s while started; Node has no Wi-Fi SSID either, so
|
|
213
|
+
an interface is identified by its MAC and IPv4 network. A custom `discovery` turns it off unless the new
|
|
214
|
+
`networkMonitor` option is given, and `networkMonitor: false` turns it off; a `NetworkMonitor` of your own drives it in
|
|
215
|
+
tests. There is no method for the app to call.
|
|
216
|
+
- Presentation mode: `PresentationConnection.send()` takes ArrayBuffer, ArrayBufferView and Blob as well as strings,
|
|
217
|
+
and `binaryType` (`arraybuffer` or `blob`) picks what `message` events carry, as in Chrome. Binary goes to wired
|
|
218
|
+
displays, in both directions. To a Cast device it is dropped without an error, as Chrome's
|
|
219
|
+
`CastSessionClientImpl::OnMessage` ignores messages that are not text. One 64 MiB cap holds for text and bytes in both
|
|
220
|
+
directions; a larger `send()` throws `RangeError`, and a detached ArrayBuffer is a `TypeError`. Before,
|
|
221
|
+
`send()` threw a `TypeError` for anything but a string.
|
|
222
|
+
|
|
223
|
+
### Changed
|
|
224
|
+
|
|
225
|
+
- **Devices are tracked as Chrome's Media Router tracks them.** electron-cast opens a channel to every device mDNS
|
|
226
|
+
finds (after Chrome's random delay of up to 5 s), runs device authentication on it, and lists the device only once
|
|
227
|
+
that has passed. A failed attempt is retried with Chrome's backoff (15 s, 3 attempts); a device that fails
|
|
228
|
+
authentication is never listed, where before it appeared in the picker and failed on use. The channel then stays
|
|
229
|
+
open, with a ping every 5 s, and is reopened after a failure (sleep and resume included); a device is dropped only
|
|
230
|
+
when it cannot be reopened, not when mDNS stops reporting it. The list is reported once it has been quiet for 3 s.
|
|
231
|
+
`manager.devices()`, the picker's list and the sinks observers show these devices, so **right after `start()` the
|
|
232
|
+
list is empty and fills in over a few seconds**.
|
|
233
|
+
- **`createClient` is called once per device, and its signature is now `(device, params)`.** A device's channel is
|
|
234
|
+
shared by its sessions and kept open, so clients live as long as the device is a sink, not as long as a session,
|
|
235
|
+
and must be fine to keep connected. `createClient` is called again after a failure, with
|
|
236
|
+
`params = { connectTimeoutMs, livenessTimeoutMs }` for that attempt; pass them on to `CastClient`
|
|
237
|
+
(`connectTimeoutMs`, `heartbeatTimeoutMs`). A channel replaced because the device's address changed stays open while
|
|
238
|
+
a session uses it (as Chrome leaves the old socket); an address list that mDNS merely reorders changes nothing. A
|
|
239
|
+
device whose host is not an IP address is skipped with a warning.
|
|
240
|
+
- **App availability for pages, as in Chrome.** In the default mode a page's `getAvailability()` and the devices its
|
|
241
|
+
`start()` offers come from the devices' own answer to `GET_APP_AVAILABILITY` for the request's app, asked over the
|
|
242
|
+
channels already open (Chrome's `CastAppDiscoveryServiceImpl`): a device that does not have the app is not offered,
|
|
243
|
+
availability turns true as soon as a device says it has the app, and `change` events follow each answer. An
|
|
244
|
+
"available" answer stands, an "unavailable" one for a minute, no answer never. `discoverSinksNow()` asks again by
|
|
245
|
+
the same rules. `mode: "chromecast"` still goes by capabilities.
|
|
246
|
+
- **Public and loopback device addresses are refused, as in Chrome.** Chrome opens no Cast channel to a publicly
|
|
247
|
+
routable or loopback address unless `MediaRouterCastAllowAllIPs` is set (`CastMediaSinkServiceImpl::OpenChannel`).
|
|
248
|
+
The sink service checks the address each time it opens a channel, so such a device is not listed, offered or
|
|
249
|
+
connected to; `sinks: { allowAllIps: true }` turns it off. Private, link-local, unique-local and `100.64.0.0/10`
|
|
250
|
+
addresses are unaffected.
|
|
251
|
+
- `joinRunningSession` is answered from the session tracker instead of connecting to every device and asking, with the
|
|
252
|
+
same results and errors; the device must be listed (its channel open) by then. A session whose pages all let go now
|
|
253
|
+
stays a (non-local) route while the device runs it, where it used to disappear from the list.
|
|
254
|
+
- `navigator.presentation.defaultRequest` is now a nullable attribute as in Blink: it takes a `PresentationRequest`
|
|
255
|
+
or `null` and throws `TypeError` for anything else. `connectionavailable` fires after the current task, as Blink
|
|
256
|
+
enqueues it.
|
|
257
|
+
- Up to 1024 media requests from a page may wait for the receiver's answer, as in Chrome
|
|
258
|
+
(`kMaxPendingMediaRequests`); a full table drops its older half before taking the new one (it was 100).
|
|
259
|
+
|
|
260
|
+
### Fixed
|
|
261
|
+
|
|
262
|
+
- **Mirroring and remote-playback sources are never launched as ordinary apps.** A presentation URL naming a Cast
|
|
263
|
+
Streaming app (`0F5096E8`, `85CDB22F`), alone or beside other apps in one legacy URL, and a `remote-playback:` URL
|
|
264
|
+
are unavailable (`getAvailability()` is `false`) and `start()` rejects with `NotFoundError` ("No screens found.").
|
|
265
|
+
Of several URLs the first ordinary Cast app one is served. The stand-in's `PresentationRequest` drops URLs of unknown
|
|
266
|
+
protocol like Blink and throws `NotSupportedError` when none is left.
|
|
267
|
+
- A device that fails device authentication no longer shows in the picker (see Changed).
|
|
268
|
+
|
|
269
|
+
### Documentation
|
|
270
|
+
|
|
271
|
+
- A rewritten README with a Chrome parity table (including what is out of scope, such as Chrome's Global Media
|
|
272
|
+
Controls panel, and what is partly done: access-code
|
|
273
|
+
casting, without the code lookup), a getting-started page, guides (device picker, restart rejoin, windows and iframes, custom
|
|
274
|
+
receivers, audio-only devices and groups, device authentication, the low-level client, testing), troubleshooting
|
|
275
|
+
and a FAQ, architecture diagrams and a glossary, a map of the Chromium code each module follows, and CONTRIBUTING.
|
|
276
|
+
- Tested-on facts: casting, rejoin after a force-kill, and stop verified end to end in an Electron 45 app on Linux
|
|
277
|
+
(Ubuntu under WSL2, dev and packaged builds) as well as Windows; IPv6 discovery and the Cast channel with TLS and device
|
|
278
|
+
authentication over unique-local and link-local addresses verified on real devices.
|
|
279
|
+
- `npm run check` now also checks the docs: every public export is mentioned, the TypeScript examples typecheck
|
|
280
|
+
against the sources, and relative links and anchors resolve; `npm run docs:check:chromium` (network) rechecks the
|
|
281
|
+
Chromium citations. Comment fixes only in `src/`.
|
|
282
|
+
|
|
3
283
|
## 0.4.0
|
|
4
284
|
|
|
5
285
|
- **Devices are now verified, as in Chrome.** `CastClient.connect()` runs the Cast device authentication challenge
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Contributing to electron-cast
|
|
2
|
+
|
|
3
|
+
Thanks for helping. electron-cast brings Chrome's Cast support to Electron, and the most useful things you can bring are
|
|
4
|
+
a bug fix, a doc fix, or a report from a device and a desktop we have not tried.
|
|
5
|
+
|
|
6
|
+
Start here:
|
|
7
|
+
|
|
8
|
+
- [Report a Cast device you tested](#test-on-real-devices): the most wanted contribution.
|
|
9
|
+
- [Fix a bug or a doc](#how-to-contribute): open a pull request directly.
|
|
10
|
+
- [Add a feature or change the API](#how-to-contribute): open an issue first.
|
|
11
|
+
- [Report a security problem](#security-issues): privately, never in an issue.
|
|
12
|
+
|
|
13
|
+
## How to contribute
|
|
14
|
+
|
|
15
|
+
| You want to | Do this |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Fix a bug, or fix or improve the docs | Open a pull request. No issue needed. |
|
|
18
|
+
| Add a feature, or change the public API | Open an issue first. We agree on the Chromium behaviour it matches before you write code. |
|
|
19
|
+
| Report a bug | Open an issue with the bug form. |
|
|
20
|
+
| Say what works on your device or OS | Open an issue with the device report form. |
|
|
21
|
+
| Report a vulnerability | Use a [private advisory](#security-issues). |
|
|
22
|
+
|
|
23
|
+
There is no CLA and no sign-off line. By contributing you agree your work is licensed under the [MIT license](LICENSE), the
|
|
24
|
+
same as the project (inbound = outbound).
|
|
25
|
+
|
|
26
|
+
### AI-assisted contributions
|
|
27
|
+
|
|
28
|
+
Welcome. Use whatever tools help you. You do not need to say you used them.
|
|
29
|
+
|
|
30
|
+
You own what you submit. That means you understand every line, you ran it, and you can explain it in review. Check every
|
|
31
|
+
Chromium citation yourself, by opening the file: a tool can invent a source, a function name or a test result. Keep the pull
|
|
32
|
+
request small enough for a person to review.
|
|
33
|
+
|
|
34
|
+
## The rules
|
|
35
|
+
|
|
36
|
+
### Behave as Chrome, and cite Chromium
|
|
37
|
+
|
|
38
|
+
This is a hard rule. electron-cast does what Chrome does. When the library has a choice to make (what to check, which error
|
|
39
|
+
to return, what to do after a navigation), the answer is what Chrome does.
|
|
40
|
+
|
|
41
|
+
- **Every behaviour change cites the Chromium (or Open Screen) source it matches.** Give the file and the function, and link
|
|
42
|
+
it on chromium.googlesource.com. Put the citation in the comment next to the code.
|
|
43
|
+
- Cite the file and the symbol, never a line number. Lines move.
|
|
44
|
+
- Read the source on `main` before you write the citation. Do not cite from memory or from a search snippet.
|
|
45
|
+
- Deviations are accepted only when Electron forces them. Each one is written down in [docs/DESIGN.md](docs/DESIGN.md) with
|
|
46
|
+
the reason, and noted in the code and the changelog. A silent difference is a bug.
|
|
47
|
+
- App-specific features belong in the app, not in the library. `src/` never knows which app uses it.
|
|
48
|
+
- **`mode: "chromecast"` is frozen.** The legacy `chrome.cast` polyfill (`src/polyfill/install.ts`) gets fixes for crashes
|
|
49
|
+
and security problems and nothing else. No new features. New work goes on the Presentation API path.
|
|
50
|
+
- **No runtime dependencies.** `dependencies` in `package.json` stays empty. Dev dependencies are fine when a tool needs
|
|
51
|
+
one.
|
|
52
|
+
|
|
53
|
+
### Finding the Chromium source
|
|
54
|
+
|
|
55
|
+
Search and browse at [source.chromium.org](https://source.chromium.org/chromium/chromium/src), and link to
|
|
56
|
+
`https://chromium.googlesource.com/chromium/src/+/refs/heads/main/<path>`. Open Screen lives in
|
|
57
|
+
`https://chromium.googlesource.com/openscreen`. Where to look:
|
|
58
|
+
|
|
59
|
+
| Area | Path in Chromium |
|
|
60
|
+
|---|---|
|
|
61
|
+
| Media Router: sinks, routes, Cast sessions, Cast channels | `chrome/browser/media/router/` (the Cast provider is `providers/cast/`) |
|
|
62
|
+
| Media Router: shared parts, Presentation API plumbing | `components/media_router/` |
|
|
63
|
+
| Tab and desktop mirroring | `components/mirroring/` |
|
|
64
|
+
| The page-side Presentation API | `third_party/blink/renderer/modules/presentation/` |
|
|
65
|
+
| Cast protocol, discovery, authentication (Open Screen) | `cast/` in openscreen |
|
|
66
|
+
|
|
67
|
+
Add or update a row in [docs/CHROMIUM-MAP.md](docs/CHROMIUM-MAP.md): the electron-cast file, the Chromium file, the symbols,
|
|
68
|
+
what is mirrored, and how electron-cast differs. Then run the citation check, which needs the network:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
npm run docs:check:chromium
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
It fetches each Chromium file linked from the map, looks for each cited symbol in it, and checks that every
|
|
75
|
+
Chromium-style path written in backticks in `docs/` exists. Chromium moves code around: a failure usually means the
|
|
76
|
+
citation needs updating, not that the library is wrong.
|
|
77
|
+
|
|
78
|
+
### Security-sensitive code
|
|
79
|
+
|
|
80
|
+
The page is untrusted and the main process is trusted. Everything that arrives over IPC is validated in the main process.
|
|
81
|
+
The origin and frame come from `event.senderFrame`, never from the message. A page never names a host or port. Read
|
|
82
|
+
[SECURITY.md](SECURITY.md) before you change `src/electron/` or the client's authentication, and do not weaken a check to
|
|
83
|
+
make a test pass.
|
|
84
|
+
|
|
85
|
+
### Comments
|
|
86
|
+
|
|
87
|
+
Comments explain why, and cite Chromium where the behaviour is Chrome's. They do not narrate the change that added them.
|
|
88
|
+
|
|
89
|
+
## Set up
|
|
90
|
+
|
|
91
|
+
You need Node 20 or later (the `engines` field in `package.json`). CI uses Node 24. Running TypeScript files directly, as
|
|
92
|
+
`node examples/discover.ts` does, needs a Node that strips types: 22.18 or later.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
git clone https://github.com/adammpkins/electron-cast.git
|
|
96
|
+
cd electron-cast
|
|
97
|
+
npm ci
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Electron is an optional peer dependency and `npm ci` does not install it. Only the smoke test and the live harnesses need
|
|
101
|
+
it, and they install it for you or tell you how.
|
|
102
|
+
|
|
103
|
+
| Command | What it does |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `npm run check` | Typecheck, lint (oxlint), unit tests and the docs check. No network. This is the CI gate. |
|
|
106
|
+
| `npm run build` | Builds `dist/` (ES modules) and `dist/cjs/` (CommonJS). |
|
|
107
|
+
| `npm test` | The unit tests alone, on Node's own test runner. |
|
|
108
|
+
| `npm run typecheck`, `npm run lint` | Each step of `npm run check` on its own. |
|
|
109
|
+
| `npm run docs:check` | The docs checks alone. No network. |
|
|
110
|
+
| `npm run docs:check:chromium` | Checks the Chromium citations. Needs the network. |
|
|
111
|
+
| `npm run smoke` | Builds, then loads the built package in a real Electron with a fake network. |
|
|
112
|
+
| `npm run canary` | Checks Google's Cast sender SDK still speaks what we translate. Needs the network. |
|
|
113
|
+
|
|
114
|
+
Run one test file:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
node --test --test-force-exit --test-timeout=20000 test/client/cast-client.test.ts
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Repository layout
|
|
121
|
+
|
|
122
|
+
| Path | What is there |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `src/discovery/` | mDNS discovery of Cast devices, and the address policy |
|
|
125
|
+
| `src/dial/` | DIAL discovery and launch |
|
|
126
|
+
| `src/protocol/`, `src/client/` | The Cast v2 wire format, device authentication, and the channel client |
|
|
127
|
+
| `src/electron/` | The main-process manager, sessions, routes, media control, the network monitor, access code casting, and the preload |
|
|
128
|
+
| `src/mirroring/` | Tab and desktop mirroring: the Cast Streaming sender (`sender/`, `rtp/`, `rtcp/`, `transport/`), the session host, codec choice, statistics (`stats/`), and the Electron capture and utility process (`electron/`) |
|
|
129
|
+
| `src/polyfill/` | The page side: the stand-in Presentation API and the frozen `chrome.cast` polyfill |
|
|
130
|
+
| `src/cli.ts`, `src/dial-test/` | The `electron-cast` command (the package's `bin`, built to `dist/cli.js`) and its `dial-test` |
|
|
131
|
+
| `src/index.ts` | The package's main entry |
|
|
132
|
+
| `test/` | Unit tests, with fakes for everything outside the process |
|
|
133
|
+
| `smoke/` | The Electron smoke test, mirroring included |
|
|
134
|
+
| `tools/` | Docs checks, the SDK canary and the trace recorder |
|
|
135
|
+
| `examples/` | A small app (`electron-app/`), a discovery script (`discover.ts`), and the live mirroring harness that casts to a real device (`live-mirroring/`) |
|
|
136
|
+
| `docs/` | The documentation: API, design, the Chromium map, guides |
|
|
137
|
+
| `site/` | The documentation website (VitePress) |
|
|
138
|
+
|
|
139
|
+
## Test your change
|
|
140
|
+
|
|
141
|
+
CI runs two gates. Both must pass:
|
|
142
|
+
|
|
143
|
+
1. **`npm run check`** on Linux, Windows and macOS.
|
|
144
|
+
2. **The Electron smoke test** on Electron 35, 40 and the latest, on the same three systems.
|
|
145
|
+
|
|
146
|
+
New behaviour needs a test that fails without it. Use the fakes the tests already have: a fake receiver (a TLS server on
|
|
147
|
+
127.0.0.1, `test/client/fake-receiver.ts`), a fake discovery socket, fake clients and a fake `ipcMain`. **No test uses a
|
|
148
|
+
real device or the real network.**
|
|
149
|
+
|
|
150
|
+
### The smoke test
|
|
151
|
+
|
|
152
|
+
It loads the built package by name inside a real Electron with a sandboxed preload, and drives it from a page. Electron is
|
|
153
|
+
installed into its own folder:
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
npm i --prefix smoke/.out/electron --no-package-lock electron@45
|
|
157
|
+
npm run smoke
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
On Linux it needs a display (`xvfb-run`) and Electron's sandbox helper allowed. `.github/workflows/ci.yml` shows the steps.
|
|
161
|
+
|
|
162
|
+
### The SDK canary
|
|
163
|
+
|
|
164
|
+
Google can change its Cast sender SDK per Chrome major without an electron-cast release, and the stand-in depends on what the
|
|
165
|
+
SDK sends. `npm run canary` (`tools/sdk-canary.mjs`) fetches the SDK for Chrome stable, beta and dev, and for the Chromium in
|
|
166
|
+
Electron 45, and compares it with `tools/sdk-canary-baseline.json`. The downloaded JavaScript is only searched as text, never
|
|
167
|
+
run. A weekly workflow opens an issue when it fails. Exit codes: 0 compatible, 1 incompatible, 2 could not run. Update the
|
|
168
|
+
baseline deliberately, with `--update-baseline`, after reading what changed.
|
|
169
|
+
|
|
170
|
+
### The docs checks
|
|
171
|
+
|
|
172
|
+
`npm run docs:check` fails when a public export is missing from the API reference, a TypeScript block in the Markdown does
|
|
173
|
+
not typecheck, or a relative link or `#anchor` does not resolve. Mark a fragment or a signature with `no-check` after the
|
|
174
|
+
language (` ```ts no-check `) or put `<!-- no-check -->` on the line before the block.
|
|
175
|
+
|
|
176
|
+
## Test on real devices
|
|
177
|
+
|
|
178
|
+
The unit tests cannot tell us how real hardware behaves. We want reports, especially from:
|
|
179
|
+
|
|
180
|
+
- **macOS** (not tested yet).
|
|
181
|
+
- **Real Linux desktops**: GNOME and KDE, on X11 and on Wayland.
|
|
182
|
+
- **DIAL smart TVs.**
|
|
183
|
+
- **Two network adapters** (Wi-Fi and Ethernet, a VPN, a virtual switch).
|
|
184
|
+
- **Cast groups.**
|
|
185
|
+
- **Older Chromecasts.**
|
|
186
|
+
|
|
187
|
+
What has been tested, and what has not, is in the [README](README.md#platforms-and-what-was-tested). A report that fills a
|
|
188
|
+
gap is a real contribution, even if everything works.
|
|
189
|
+
|
|
190
|
+
### Send a device report
|
|
191
|
+
|
|
192
|
+
Open an issue with the **Device report** form (`.github/ISSUE_TEMPLATE/device-report.yml`). If you prefer to write it
|
|
193
|
+
yourself, this is what it needs:
|
|
194
|
+
|
|
195
|
+
```md
|
|
196
|
+
**OS and version:**
|
|
197
|
+
**Electron version:**
|
|
198
|
+
**electron-cast version:**
|
|
199
|
+
**Device model and Cast firmware:**
|
|
200
|
+
**Network:** IPv4 / IPv6 / both, how many adapters, Wi-Fi or wired
|
|
201
|
+
**What I tried:**
|
|
202
|
+
**What worked:**
|
|
203
|
+
**What failed:**
|
|
204
|
+
**Logs (scrubbed):**
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Run the live harnesses
|
|
208
|
+
|
|
209
|
+
These cast to a real device. The mirroring harness lives in `examples/live-mirroring/`. Build the library first, then:
|
|
210
|
+
|
|
211
|
+
```sh
|
|
212
|
+
npm run build
|
|
213
|
+
cd examples/live-mirroring
|
|
214
|
+
npm install
|
|
215
|
+
npm start # lists devices that can receive tab mirroring, then quits
|
|
216
|
+
npm run tab -- "<device name>" # mirror the demo window
|
|
217
|
+
npm run desktop -- "<device name>" # mirror the primary screen
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
DIAL TVs are probed with `electron-cast dial-test` (`src/dial-test/`, built to `dist/cli.js`; [how a volunteer runs
|
|
221
|
+
it](README.md#test-a-dial-tv)). It uses the library's own SSDP discovery, description fetch, app info, launch and stop, so what
|
|
222
|
+
it reports is what the library does. Everything it does is read-only except opening and closing YouTube, which it does only
|
|
223
|
+
after asking. It scrubs its report once, at the end, in `src/dial-test/scrub.ts`; anything new that goes into the report is
|
|
224
|
+
scrubbed there, and the tests in `test/dial-test/` fail if a name, serial number, UDN, MAC, address or app-info value from
|
|
225
|
+
the fake device appears in it. Do not run it against devices that are not yours.
|
|
226
|
+
|
|
227
|
+
The trace recorder (`tools/capture-trace.mjs`) runs one session against a device: it connects, launches the Default Media
|
|
228
|
+
Receiver, loads a public video, pauses, plays and stops, and always stops the app it launched. It scrubs names, ids and
|
|
229
|
+
addresses before it writes a file, and refuses to write if something still looks like an IP, MAC or id.
|
|
230
|
+
|
|
231
|
+
```sh
|
|
232
|
+
node tools/capture-trace.mjs --dry-run --out trace.json # a fake receiver, no network
|
|
233
|
+
node tools/capture-trace.mjs --host <device ip> --out trace.json # a real device
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Each harness has a README or header comment with its options. The rules for all of them:
|
|
237
|
+
|
|
238
|
+
- **Use your own devices only.** Never cast to a device that is not yours to disturb.
|
|
239
|
+
- The live harnesses ask before they start casting. Read what the dialog says.
|
|
240
|
+
- The harnesses and the trace recorder play and stop media on the device you pick.
|
|
241
|
+
|
|
242
|
+
### Scrub before you post
|
|
243
|
+
|
|
244
|
+
Paste only scrubbed output. **Never post** device names, device ids, IP addresses, MAC addresses, Wi-Fi network names or
|
|
245
|
+
certificates. Not in an issue, a pull request, a test fixture or a commit. Replace them (`Living Room TV`, `192.0.2.10`)
|
|
246
|
+
and read the output again before you post it. The model and firmware are fine.
|
|
247
|
+
|
|
248
|
+
## Documentation
|
|
249
|
+
|
|
250
|
+
Docs are part of the change. A pull request that changes behaviour updates, as they apply:
|
|
251
|
+
|
|
252
|
+
- the [README](README.md) parity table, when Chrome parity changes;
|
|
253
|
+
- [docs/CHROMIUM-MAP.md](docs/CHROMIUM-MAP.md), for every new citation;
|
|
254
|
+
- [docs/DESIGN.md](docs/DESIGN.md), for behaviour and for every deviation from Chrome;
|
|
255
|
+
- the [API reference](docs/API.md) or [main-process API](docs/MAIN-API.md), for a public change;
|
|
256
|
+
- [CHANGELOG.md](CHANGELOG.md), under `## Unreleased`, for anything a user can see.
|
|
257
|
+
|
|
258
|
+
Each file in `docs/` starts with one `# Title` and a one-sentence summary, and pages link to each other with relative
|
|
259
|
+
links.
|
|
260
|
+
|
|
261
|
+
The website lives in `site/` and is built from `docs/`. To preview it:
|
|
262
|
+
|
|
263
|
+
```sh
|
|
264
|
+
cd site
|
|
265
|
+
npm ci
|
|
266
|
+
npm run dev
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
It is published at <https://adammpkins.github.io/electron-cast/>.
|
|
270
|
+
|
|
271
|
+
## Commits and pull requests
|
|
272
|
+
|
|
273
|
+
Commit messages are plain and in the imperative: "Bound pending media requests at Chrome's 1024". The first line says what
|
|
274
|
+
changed. The body, when there is one, says why. Run `git log` and match what you see.
|
|
275
|
+
|
|
276
|
+
Before you open a pull request:
|
|
277
|
+
|
|
278
|
+
- [ ] One change, with a clear description of what and why.
|
|
279
|
+
- [ ] Every behaviour change cites its Chromium source, and `npm run docs:check:chromium` passes.
|
|
280
|
+
- [ ] Any deviation from Chrome is in `docs/DESIGN.md` with the reason.
|
|
281
|
+
- [ ] New behaviour has tests that use the existing fakes.
|
|
282
|
+
- [ ] `npm run check` and `npm run build` pass. The smoke test passes if you touched `src/electron/` or `src/polyfill/`.
|
|
283
|
+
- [ ] Docs and `CHANGELOG.md` are updated.
|
|
284
|
+
- [ ] No runtime dependencies added, and nothing app-specific in `src/`.
|
|
285
|
+
- [ ] No device names, ids, addresses, MACs, Wi-Fi names or certificates anywhere.
|
|
286
|
+
|
|
287
|
+
## Security issues
|
|
288
|
+
|
|
289
|
+
Do not open a public issue for a security problem. Use GitHub's private vulnerability reporting: open the **Security** tab
|
|
290
|
+
of [the repository](https://github.com/adammpkins/electron-cast) and choose **Report a vulnerability**. [SECURITY.md](SECURITY.md)
|
|
291
|
+
says what to include and what the library trusts.
|
|
292
|
+
|
|
293
|
+
## Releases
|
|
294
|
+
|
|
295
|
+
Maintainers only. A release is published by `.github/workflows/publish.yml` from a tag, with npm trusted publishing and a
|
|
296
|
+
provenance attestation.
|
|
297
|
+
|
|
298
|
+
1. On `main`, with a clean tree: `npm ci`, `npm run check`, `npm run build` and `npm run smoke`. Run `npm run canary` and
|
|
299
|
+
read the result.
|
|
300
|
+
2. Move the `## Unreleased` entries of the changelog under a new `## <version>` heading.
|
|
301
|
+
3. Set `version` in `package.json` and the lockfile (`npm install --package-lock-only`).
|
|
302
|
+
4. Commit, then tag and push: `git tag v<version> && git push origin main v<version>`. The workflow refuses a tag that does
|
|
303
|
+
not match `package.json`, skips a version already on npm, runs `npm run check`, and publishes.
|
|
304
|
+
5. Confirm the version on npm, and that `electron-cast`, `electron-cast/main` and `electron-cast/preload` import from a fresh
|
|
305
|
+
install.
|