electron-cast 0.3.1 → 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 +340 -0
- package/CONTRIBUTING.md +305 -0
- package/README.md +215 -60
- package/SECURITY.md +324 -0
- package/dist/cjs/client/auth/build-time.d.ts +7 -0
- package/dist/cjs/client/auth/build-time.js +11 -0
- package/dist/cjs/client/auth/build-time.js.map +1 -0
- package/dist/cjs/client/auth/cast-auth.d.ts +46 -0
- package/dist/cjs/client/auth/cast-auth.js +145 -0
- package/dist/cjs/client/auth/cast-auth.js.map +1 -0
- package/dist/cjs/client/auth/cast-cert-validator.d.ts +34 -0
- package/dist/cjs/client/auth/cast-cert-validator.js +89 -0
- package/dist/cjs/client/auth/cast-cert-validator.js.map +1 -0
- package/dist/cjs/client/auth/crl.d.ts +45 -0
- package/dist/cjs/client/auth/crl.js +227 -0
- package/dist/cjs/client/auth/crl.js.map +1 -0
- package/dist/cjs/client/auth/der.d.ts +62 -0
- package/dist/cjs/client/auth/der.js +208 -0
- package/dist/cjs/client/auth/der.js.map +1 -0
- package/dist/cjs/client/auth/names.d.ts +52 -0
- package/dist/cjs/client/auth/names.js +447 -0
- package/dist/cjs/client/auth/names.js.map +1 -0
- package/dist/cjs/client/auth/path-validator.d.ts +29 -0
- package/dist/cjs/client/auth/path-validator.js +421 -0
- package/dist/cjs/client/auth/path-validator.js.map +1 -0
- package/dist/cjs/client/auth/trust-data.d.ts +24 -0
- package/dist/cjs/client/auth/trust-data.js +97 -0
- package/dist/cjs/client/auth/trust-data.js.map +1 -0
- package/dist/cjs/client/auth/x509.d.ts +109 -0
- package/dist/cjs/client/auth/x509.js +442 -0
- package/dist/cjs/client/auth/x509.js.map +1 -0
- package/dist/cjs/client/cast-client.d.ts +111 -0
- package/dist/cjs/client/cast-client.js +505 -0
- package/dist/cjs/client/cast-client.js.map +1 -0
- package/dist/cjs/client/errors.d.ts +28 -0
- package/dist/cjs/client/errors.js +50 -0
- package/dist/cjs/client/errors.js.map +1 -0
- package/dist/cjs/client/index.d.ts +6 -0
- package/dist/cjs/client/index.js +21 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/client/namespaces.d.ts +9 -0
- package/dist/cjs/client/namespaces.js +13 -0
- package/dist/cjs/client/namespaces.js.map +1 -0
- package/dist/cjs/client/types.d.ts +27 -0
- package/dist/cjs/client/types.js +3 -0
- package/dist/cjs/client/types.js.map +1 -0
- 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 +105 -0
- package/dist/cjs/discovery/cast-discovery.js +323 -0
- package/dist/cjs/discovery/cast-discovery.js.map +1 -0
- package/dist/cjs/discovery/device-cache.d.ts +54 -0
- package/dist/cjs/discovery/device-cache.js +240 -0
- package/dist/cjs/discovery/device-cache.js.map +1 -0
- package/dist/cjs/discovery/dns-packet.d.ts +70 -0
- package/dist/cjs/discovery/dns-packet.js +251 -0
- package/dist/cjs/discovery/dns-packet.js.map +1 -0
- package/dist/cjs/discovery/index.d.ts +5 -0
- package/dist/cjs/discovery/index.js +22 -0
- package/dist/cjs/discovery/index.js.map +1 -0
- 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 +19 -0
- package/dist/cjs/discovery/udp-socket.js +166 -0
- package/dist/cjs/discovery/udp-socket.js.map +1 -0
- 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 +173 -0
- package/dist/cjs/electron/main.js +990 -0
- package/dist/cjs/electron/main.js.map +1 -0
- package/dist/cjs/electron/manager-api.d.ts +314 -0
- package/dist/cjs/electron/manager-api.js +402 -0
- package/dist/cjs/electron/manager-api.js.map +1 -0
- 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.d.ts +39 -0
- package/dist/cjs/electron/preload.js +96 -0
- package/dist/cjs/electron/preload.js.map +1 -0
- package/dist/cjs/electron/presentation-envelope.d.ts +60 -0
- package/dist/cjs/electron/presentation-envelope.js +318 -0
- package/dist/cjs/electron/presentation-envelope.js.map +1 -0
- package/dist/cjs/electron/presentation-handler.d.ts +135 -0
- package/dist/cjs/electron/presentation-handler.js +643 -0
- package/dist/cjs/electron/presentation-handler.js.map +1 -0
- 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 +348 -0
- package/dist/cjs/electron/session-service.js +1273 -0
- package/dist/cjs/electron/session-service.js.map +1 -0
- 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 +9 -0
- package/dist/cjs/index.js +27 -0
- package/dist/cjs/index.js.map +1 -0
- 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/package.json +1 -0
- package/dist/cjs/polyfill/bridge-types.d.ts +97 -0
- package/dist/cjs/polyfill/bridge-types.js +3 -0
- package/dist/cjs/polyfill/bridge-types.js.map +1 -0
- package/dist/cjs/polyfill/install.d.ts +12 -0
- package/dist/cjs/polyfill/install.js +1569 -0
- package/dist/cjs/polyfill/install.js.map +1 -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.d.ts +13 -0
- package/dist/cjs/polyfill/presentation-standin.js +421 -0
- package/dist/cjs/polyfill/presentation-standin.js.map +1 -0
- package/dist/cjs/protocol/cast-message.d.ts +20 -0
- package/dist/cjs/protocol/cast-message.js +171 -0
- package/dist/cjs/protocol/cast-message.js.map +1 -0
- package/dist/cjs/protocol/device-auth.d.ts +61 -0
- package/dist/cjs/protocol/device-auth.js +113 -0
- package/dist/cjs/protocol/device-auth.js.map +1 -0
- package/dist/cjs/protocol/errors.d.ts +4 -0
- package/dist/cjs/protocol/errors.js +12 -0
- package/dist/cjs/protocol/errors.js.map +1 -0
- package/dist/cjs/protocol/framing.d.ts +18 -0
- package/dist/cjs/protocol/framing.js +100 -0
- package/dist/cjs/protocol/framing.js.map +1 -0
- package/dist/cjs/protocol/index.d.ts +4 -0
- package/dist/cjs/protocol/index.js +21 -0
- package/dist/cjs/protocol/index.js.map +1 -0
- package/dist/cjs/protocol/proto-wire.d.ts +11 -0
- package/dist/cjs/protocol/proto-wire.js +64 -0
- package/dist/cjs/protocol/proto-wire.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/client/auth/build-time.js +8 -0
- package/dist/client/auth/build-time.js.map +1 -0
- package/dist/client/auth/cast-auth.d.ts +46 -0
- package/dist/client/auth/cast-auth.js +141 -0
- package/dist/client/auth/cast-auth.js.map +1 -0
- package/dist/client/auth/cast-cert-validator.d.ts +34 -0
- package/dist/client/auth/cast-cert-validator.js +86 -0
- package/dist/client/auth/cast-cert-validator.js.map +1 -0
- package/dist/client/auth/crl.d.ts +45 -0
- package/dist/client/auth/crl.js +221 -0
- package/dist/client/auth/crl.js.map +1 -0
- package/dist/client/auth/der.d.ts +62 -0
- package/dist/client/auth/der.js +196 -0
- package/dist/client/auth/der.js.map +1 -0
- package/dist/client/auth/names.d.ts +52 -0
- package/dist/client/auth/names.js +438 -0
- package/dist/client/auth/names.js.map +1 -0
- package/dist/client/auth/path-validator.d.ts +29 -0
- package/dist/client/auth/path-validator.js +417 -0
- package/dist/client/auth/path-validator.js.map +1 -0
- package/dist/client/auth/trust-data.d.ts +24 -0
- package/dist/client/auth/trust-data.js +94 -0
- package/dist/client/auth/trust-data.js.map +1 -0
- package/dist/client/auth/x509.d.ts +109 -0
- package/dist/client/auth/x509.js +430 -0
- package/dist/client/auth/x509.js.map +1 -0
- package/dist/client/cast-client.d.ts +20 -1
- package/dist/client/cast-client.js +74 -3
- package/dist/client/cast-client.js.map +1 -1
- package/dist/client/errors.d.ts +11 -0
- package/dist/client/errors.js +13 -0
- package/dist/client/errors.js.map +1 -1
- package/dist/client/index.d.ts +2 -0
- 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 +23 -2
- package/dist/discovery/cast-discovery.js +94 -14
- package/dist/discovery/cast-discovery.js.map +1 -1
- package/dist/discovery/device-cache.d.ts +15 -1
- package/dist/discovery/device-cache.js +31 -7
- 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 +8 -1
- package/dist/discovery/udp-socket.js +59 -5
- 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 +122 -13
- package/dist/electron/main.js +776 -63
- package/dist/electron/main.js.map +1 -1
- package/dist/electron/manager-api.d.ts +314 -0
- package/dist/electron/manager-api.js +390 -0
- package/dist/electron/manager-api.js.map +1 -0
- 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.d.ts +5 -0
- package/dist/electron/preload.js +9 -1
- package/dist/electron/preload.js.map +1 -1
- package/dist/electron/presentation-envelope.js +7 -1
- package/dist/electron/presentation-envelope.js.map +1 -1
- package/dist/electron/presentation-handler.d.ts +39 -4
- package/dist/electron/presentation-handler.js +208 -57
- 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 +225 -10
- package/dist/electron/session-service.js +735 -151
- 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 +160 -17
- package/dist/polyfill/presentation-standin.js.map +1 -1
- package/dist/protocol/device-auth.d.ts +61 -0
- package/dist/protocol/device-auth.js +106 -0
- package/dist/protocol/device-auth.js.map +1 -0
- package/dist/protocol/framing.d.ts +1 -1
- package/dist/protocol/framing.js +1 -1
- package/dist/protocol/framing.js.map +1 -1
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/proto-wire.d.ts +11 -0
- package/dist/protocol/proto-wire.js +60 -0
- package/dist/protocol/proto-wire.js.map +1 -0
- 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 +67 -16
- package/src/cli.ts +57 -0
- package/src/client/auth/build-time.ts +7 -0
- package/src/client/auth/cast-auth.ts +186 -0
- package/src/client/auth/cast-cert-validator.ts +133 -0
- package/src/client/auth/crl.ts +228 -0
- package/src/client/auth/der.ts +193 -0
- package/src/client/auth/names.ts +411 -0
- package/src/client/auth/path-validator.ts +449 -0
- package/src/client/auth/trust-data.ts +95 -0
- package/src/client/auth/x509.ts +488 -0
- package/src/client/cast-client.ts +85 -3
- package/src/client/errors.ts +29 -0
- package/src/client/index.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 +106 -19
- package/src/discovery/device-cache.ts +43 -8
- package/src/discovery/index.ts +1 -0
- package/src/discovery/ip-policy.ts +97 -0
- package/src/discovery/udp-socket.ts +66 -4
- 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 +866 -72
- package/src/electron/manager-api.ts +664 -0
- package/src/electron/media-controller.ts +313 -0
- package/src/electron/network-monitor.ts +140 -0
- package/src/electron/preload.ts +16 -2
- package/src/electron/presentation-envelope.ts +7 -1
- package/src/electron/presentation-handler.ts +211 -58
- package/src/electron/presentation-source.ts +155 -0
- package/src/electron/session-service.ts +808 -149
- 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 +150 -17
- package/src/protocol/device-auth.ts +126 -0
- package/src/protocol/framing.ts +1 -1
- package/src/protocol/index.ts +1 -0
- package/src/protocol/proto-wire.ts +55 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type PresentationUrl } from "./presentation-envelope.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The Cast Streaming receiver apps, `openscreen::cast::GetCastStreamingAppIds()` (cast/common/public/
|
|
4
|
+
* cast_streaming_app_ids.cc in the openscreen repository, which Chromium vendors): audio and video, then audio only.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CAST_STREAMING_APP_IDS: readonly string[];
|
|
7
|
+
/** What a presentation URL is to the Cast provider. */
|
|
8
|
+
export type PresentationSourceKind =
|
|
9
|
+
/** A receiver app launched by id: the only kind electron-cast serves. */
|
|
10
|
+
"cast_app"
|
|
11
|
+
/** Names a Cast Streaming app: Chrome routes it to a `MirroringActivity`. */
|
|
12
|
+
| "mirroring"
|
|
13
|
+
/** `remote-playback:`, made by `HTMLMediaElement.remote`: Chrome serves it by media remoting. */
|
|
14
|
+
| "remote_playback"
|
|
15
|
+
/** `cast-dial:` (`MediaSource::IsDialSource`): an app launched on a DIAL sink by the DIAL provider. */
|
|
16
|
+
| "dial"
|
|
17
|
+
/** Anything else (invalid, unknown scheme, a plain web page). */
|
|
18
|
+
| "other";
|
|
19
|
+
/**
|
|
20
|
+
* The app ids `CastMediaSource::FromMediaSource` reads from a Cast presentation URL, in order: the path of a `cast:`
|
|
21
|
+
* URL (`ParseCastUrl`), or every `__castAppId__` of the legacy `https://google.com/cast#...` form with its `(caps)`
|
|
22
|
+
* suffix cut off (`ParseLegacyCastUrl`, which lets one URL list several apps). Null when the URL is neither form or
|
|
23
|
+
* names no app.
|
|
24
|
+
*/
|
|
25
|
+
export declare function castUrlAppIds(url: string): string[] | null;
|
|
26
|
+
/**
|
|
27
|
+
* `CastMediaSource::ContainsStreamingApp`: some app of the URL is a Cast Streaming app. The comparison is exact, as
|
|
28
|
+
* `CastMediaSource::ContainsApp` is. A URL listing a streaming app next to ordinary ones is a mirroring source as a
|
|
29
|
+
* whole, because Chrome decides per source and not per app.
|
|
30
|
+
*/
|
|
31
|
+
export declare function containsStreamingApp(url: string): boolean;
|
|
32
|
+
/** Classifies one presentation URL as Chrome's Cast provider would. */
|
|
33
|
+
export declare function classifyPresentationUrl(url: string): PresentationSourceKind;
|
|
34
|
+
/** The URL a request is served from, with its parsed fields. */
|
|
35
|
+
export interface LaunchableUrl {
|
|
36
|
+
url: string;
|
|
37
|
+
parsed: PresentationUrl;
|
|
38
|
+
}
|
|
39
|
+
/** A `cast-dial:` URL with the app it names (`MediaSource::AppNameFromDialSource`). */
|
|
40
|
+
export interface DialSourceUrl {
|
|
41
|
+
url: string;
|
|
42
|
+
app: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The result of looking through a request's URLs for the ones to serve. A request can have a source for each kind of
|
|
46
|
+
* sink: `dial` is set when DIAL is on and the request has a `cast-dial:` URL, and the sink the user picks decides
|
|
47
|
+
* which of the two is used.
|
|
48
|
+
*/
|
|
49
|
+
export type SourceChoice = ({
|
|
50
|
+
kind: "launch";
|
|
51
|
+
dial?: DialSourceUrl;
|
|
52
|
+
} & LaunchableUrl)
|
|
53
|
+
/** Only a DIAL source can be served. */
|
|
54
|
+
| {
|
|
55
|
+
kind: "dial";
|
|
56
|
+
dial: DialSourceUrl;
|
|
57
|
+
}
|
|
58
|
+
/** Every valid source needs mirroring or remoting: there is nothing to cast to, as for a source no sink serves. */
|
|
59
|
+
| {
|
|
60
|
+
kind: "no_sink";
|
|
61
|
+
}
|
|
62
|
+
/** No URL is one electron-cast understands. */
|
|
63
|
+
| {
|
|
64
|
+
kind: "unsupported";
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Picks the URLs to launch. Chrome takes the sources of a request as a set and serves the first, in order, that the
|
|
68
|
+
* chosen sink supports (`QueryResultManager`, `MediaRouterUI`), and a page is told a screen is available when any
|
|
69
|
+
* source has one. A Cast sink supports a Cast app source and a DIAL sink a `cast-dial:` one, so this is the first
|
|
70
|
+
* plain Cast app URL and, with `dial` on, the first `cast-dial:` URL naming a valid app; a mirroring or
|
|
71
|
+
* `remote-playback:` entry never blocks an ordinary one next to it. With DIAL off a `cast-dial:` URL is one nothing
|
|
72
|
+
* here understands.
|
|
73
|
+
*/
|
|
74
|
+
export declare function chooseSource(urls: readonly string[], options?: {
|
|
75
|
+
dial?: boolean;
|
|
76
|
+
}): SourceChoice;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Which presentation URLs this library can serve, decided the way Chromium's Media Router decides what a source is.
|
|
2
|
+
// electron-cast launches receiver apps over Cast and DIAL; it does not mirror a tab or remote a media element. Chrome
|
|
3
|
+
// routes sources that name a Cast Streaming app, and `remote-playback:` sources, to code electron-cast does not have,
|
|
4
|
+
// so they must never be launched as ordinary apps. Pure module: no Electron imports.
|
|
5
|
+
import { parsePresentationUrl } from "./presentation-envelope.js";
|
|
6
|
+
import { appNameFromDialSource, isDialSource } from "../dial/parse.js";
|
|
7
|
+
/**
|
|
8
|
+
* The Cast Streaming receiver apps, `openscreen::cast::GetCastStreamingAppIds()` (cast/common/public/
|
|
9
|
+
* cast_streaming_app_ids.cc in the openscreen repository, which Chromium vendors): audio and video, then audio only.
|
|
10
|
+
*/
|
|
11
|
+
export const CAST_STREAMING_APP_IDS = ["0F5096E8", "85CDB22F"];
|
|
12
|
+
const LEGACY_PREFIX = "https://google.com/cast#";
|
|
13
|
+
/** `base::UnescapeURLComponent` with the rules `ParseLegacyCastUrl` uses, close enough for app ids. */
|
|
14
|
+
function unescape(value) {
|
|
15
|
+
const spaced = value.replace(/\+/g, " ");
|
|
16
|
+
try {
|
|
17
|
+
return decodeURIComponent(spaced);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return spaced;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The app ids `CastMediaSource::FromMediaSource` reads from a Cast presentation URL, in order: the path of a `cast:`
|
|
25
|
+
* URL (`ParseCastUrl`), or every `__castAppId__` of the legacy `https://google.com/cast#...` form with its `(caps)`
|
|
26
|
+
* suffix cut off (`ParseLegacyCastUrl`, which lets one URL list several apps). Null when the URL is neither form or
|
|
27
|
+
* names no app.
|
|
28
|
+
*/
|
|
29
|
+
export function castUrlAppIds(url) {
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = new URL(url);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (parsed.protocol === "cast:") {
|
|
38
|
+
// GURL::GetPath of `cast:ID?query` is `ID`
|
|
39
|
+
const id = unescape(parsed.pathname);
|
|
40
|
+
return id === "" ? null : [id];
|
|
41
|
+
}
|
|
42
|
+
// IsLegacyCastPresentationUrl: a case-insensitive prefix of the canonical spec
|
|
43
|
+
if (!parsed.href.toLowerCase().startsWith(LEGACY_PREFIX))
|
|
44
|
+
return null;
|
|
45
|
+
const ids = [];
|
|
46
|
+
for (const pair of parsed.hash.slice(1).split("/")) {
|
|
47
|
+
const eq = pair.indexOf("=");
|
|
48
|
+
if (eq === -1 || pair.slice(0, eq) !== "__castAppId__")
|
|
49
|
+
continue;
|
|
50
|
+
const value = unescape(pair.slice(eq + 1));
|
|
51
|
+
const paren = value.indexOf("(");
|
|
52
|
+
const id = paren === -1 ? value : value.slice(0, paren);
|
|
53
|
+
if (id !== "")
|
|
54
|
+
ids.push(id);
|
|
55
|
+
}
|
|
56
|
+
return ids.length > 0 ? ids : null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `CastMediaSource::ContainsStreamingApp`: some app of the URL is a Cast Streaming app. The comparison is exact, as
|
|
60
|
+
* `CastMediaSource::ContainsApp` is. A URL listing a streaming app next to ordinary ones is a mirroring source as a
|
|
61
|
+
* whole, because Chrome decides per source and not per app.
|
|
62
|
+
*/
|
|
63
|
+
export function containsStreamingApp(url) {
|
|
64
|
+
const ids = castUrlAppIds(url);
|
|
65
|
+
if (ids !== null && ids.some((id) => CAST_STREAMING_APP_IDS.includes(id)))
|
|
66
|
+
return true;
|
|
67
|
+
// electron-cast's own reading of the URL must not reach a streaming app either (it splits `ID(caps)` in a `cast:` path)
|
|
68
|
+
const own = parsePresentationUrl(url);
|
|
69
|
+
return own !== null && CAST_STREAMING_APP_IDS.includes(own.appId);
|
|
70
|
+
}
|
|
71
|
+
/** Classifies one presentation URL as Chrome's Cast provider would. */
|
|
72
|
+
export function classifyPresentationUrl(url) {
|
|
73
|
+
let parsed;
|
|
74
|
+
try {
|
|
75
|
+
parsed = new URL(url);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return "other";
|
|
79
|
+
}
|
|
80
|
+
// MediaSource::IsRemotePlaybackSource
|
|
81
|
+
if (parsed.protocol === "remote-playback:")
|
|
82
|
+
return "remote_playback";
|
|
83
|
+
if (isDialSource(url))
|
|
84
|
+
return "dial";
|
|
85
|
+
if (castUrlAppIds(url) === null)
|
|
86
|
+
return "other";
|
|
87
|
+
return containsStreamingApp(url) ? "mirroring" : "cast_app";
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Picks the URLs to launch. Chrome takes the sources of a request as a set and serves the first, in order, that the
|
|
91
|
+
* chosen sink supports (`QueryResultManager`, `MediaRouterUI`), and a page is told a screen is available when any
|
|
92
|
+
* source has one. A Cast sink supports a Cast app source and a DIAL sink a `cast-dial:` one, so this is the first
|
|
93
|
+
* plain Cast app URL and, with `dial` on, the first `cast-dial:` URL naming a valid app; a mirroring or
|
|
94
|
+
* `remote-playback:` entry never blocks an ordinary one next to it. With DIAL off a `cast-dial:` URL is one nothing
|
|
95
|
+
* here understands.
|
|
96
|
+
*/
|
|
97
|
+
export function chooseSource(urls, options = {}) {
|
|
98
|
+
let unservable = false;
|
|
99
|
+
let cast;
|
|
100
|
+
let dial;
|
|
101
|
+
for (const url of urls) {
|
|
102
|
+
const kind = classifyPresentationUrl(url);
|
|
103
|
+
if (kind === "mirroring" || kind === "remote_playback") {
|
|
104
|
+
unservable = true;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (kind === "dial") {
|
|
108
|
+
const app = options.dial === true && dial === undefined ? appNameFromDialSource(url) : "";
|
|
109
|
+
if (app !== "")
|
|
110
|
+
dial = { url, app };
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (kind !== "cast_app" || cast !== undefined)
|
|
114
|
+
continue;
|
|
115
|
+
const parsed = parsePresentationUrl(url);
|
|
116
|
+
if (parsed !== null)
|
|
117
|
+
cast = { url, parsed };
|
|
118
|
+
}
|
|
119
|
+
if (cast !== undefined)
|
|
120
|
+
return { kind: "launch", ...cast, ...(dial === undefined ? {} : { dial }) };
|
|
121
|
+
if (dial !== undefined)
|
|
122
|
+
return { kind: "dial", dial };
|
|
123
|
+
return unservable ? { kind: "no_sink" } : { kind: "unsupported" };
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=presentation-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-source.js","sourceRoot":"","sources":["../../src/electron/presentation-source.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { BridgeEvent, BridgeResult } from "../polyfill/bridge-types.ts";
|
|
2
|
+
import type { WiredDisplaySink } from "./wired-display/displays.ts";
|
|
2
3
|
import type { CastDevice } from "../discovery/index.ts";
|
|
3
|
-
import type { ReceiverApplication, ReceiverStatus } from "../client/index.ts";
|
|
4
|
+
import type { ReceiverApplication, ReceiverStatus, ReceiverVolume } from "../client/index.ts";
|
|
5
|
+
import { type DevicePickerContext, type MediaRoute } from "./manager-api.ts";
|
|
6
|
+
import { type ChannelParams, type CastSinkOptions } from "./sink-service.ts";
|
|
7
|
+
import type { NetworkMonitor } from "./network-monitor.ts";
|
|
8
|
+
import { type CastAppSource } from "./app-discovery.ts";
|
|
9
|
+
import { type AccessCodeDevice, type AccessCodeOptions, type AccessCodeRememberedSink, type AddSinkResult } from "./access-code.ts";
|
|
4
10
|
/** Capability bit names in bit order: 1 video_out, 2 video_in, 4 audio_out, 8 audio_in, 32 multizone_group. */
|
|
5
11
|
export declare function capabilityNames(bits: number): string[];
|
|
12
|
+
export { APP_AVAILABILITY_REFRESH_MS } from "./app-discovery.ts";
|
|
6
13
|
/** A source of known Cast devices and their change events. */
|
|
7
14
|
export interface DeviceSource {
|
|
8
15
|
devices(): CastDevice[];
|
|
@@ -11,7 +18,16 @@ export interface DeviceSource {
|
|
|
11
18
|
}
|
|
12
19
|
/** The subset of {@link CastClient} used by the session service. */
|
|
13
20
|
export interface CastClientLike {
|
|
21
|
+
/**
|
|
22
|
+
* The id this client puts in the source of its messages (`CastClient` has it). Mirroring needs it, to address the
|
|
23
|
+
* receiver's replies; a client without it cannot mirror.
|
|
24
|
+
*/
|
|
25
|
+
readonly senderId?: string;
|
|
14
26
|
readonly connected: boolean;
|
|
27
|
+
/** What device authentication found out, once connected (`CastClient.deviceAuth`); absent when the device was not verified. */
|
|
28
|
+
readonly deviceAuth?: {
|
|
29
|
+
readonly policy: string;
|
|
30
|
+
} | undefined;
|
|
15
31
|
connect(): Promise<void>;
|
|
16
32
|
close(): void;
|
|
17
33
|
send(namespace: string, destinationId: string, payload: string): void;
|
|
@@ -23,6 +39,8 @@ export interface CastClientLike {
|
|
|
23
39
|
muted: boolean;
|
|
24
40
|
}): Promise<ReceiverStatus>;
|
|
25
41
|
getStatus(): Promise<ReceiverStatus>;
|
|
42
|
+
/** `GET_APP_AVAILABILITY`; a client without it is taken to have every app. */
|
|
43
|
+
getAppAvailability?(appIds: string[]): Promise<Record<string, boolean>>;
|
|
26
44
|
connectTransport(transportId: string): void;
|
|
27
45
|
closeTransport(transportId: string): void;
|
|
28
46
|
on(event: "message", listener: (msg: ClientMessage) => void): unknown;
|
|
@@ -53,20 +71,61 @@ export interface CastRequestInfo {
|
|
|
53
71
|
sessionId: string;
|
|
54
72
|
deviceId: string;
|
|
55
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Set when the page's request could also be shown on a display (its URLs mix a Cast app URL and a standard presentation
|
|
76
|
+
* source) and displays exist: Chrome's dialog lists both kinds of sink. Answer `{ display: <sink id> }` to pick one.
|
|
77
|
+
*/
|
|
78
|
+
displays?: readonly WiredDisplaySink[];
|
|
79
|
+
}
|
|
80
|
+
/** A display chosen in a picker that also lists displays (see {@link CastRequestInfo.displays}). */
|
|
81
|
+
export interface DisplayChoice {
|
|
82
|
+
/** The id of one of `request.displays`. */
|
|
83
|
+
display: string;
|
|
56
84
|
}
|
|
57
85
|
/** The picker's answer: a device to cast to, `null` (cancel) or `"stop"` (stop the sender's current session). */
|
|
58
86
|
export type DeviceChoice = CastDevice | null | "stop";
|
|
59
87
|
/** Dependencies and callbacks of {@link CastSessionService}. */
|
|
60
88
|
export interface CastSessionServiceOptions {
|
|
61
89
|
devices: DeviceSource;
|
|
62
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Make a client for a device. `params` carries the connect and liveness timeouts Chrome would use for this attempt
|
|
92
|
+
* (10 s; longer after failures only when `sinks.dynamicTimeoutDeltaMs` is set).
|
|
93
|
+
*/
|
|
94
|
+
createClient(device: CastDevice, params: ChannelParams): CastClientLike;
|
|
63
95
|
/**
|
|
64
96
|
* Ask the user which device to cast to. Resolves a device, `null` (cancel) or
|
|
65
97
|
* `"stop"` (stop `request.session`, the sender's current session, if it has one).
|
|
66
98
|
*/
|
|
67
|
-
selectDevice(devices: CastDevice[], request: CastRequestInfo): Promise<DeviceChoice>;
|
|
99
|
+
selectDevice(devices: CastDevice[], request: CastRequestInfo, picker: DevicePickerContext): Promise<DeviceChoice>;
|
|
68
100
|
allowOrigin?(origin: string): boolean;
|
|
69
101
|
emit(senderId: number, event: BridgeEvent): void;
|
|
102
|
+
/** How channels to the devices are opened and retried; the defaults are Chrome's (see {@link CastSinkOptions}). */
|
|
103
|
+
sinks?: CastSinkOptions;
|
|
104
|
+
/**
|
|
105
|
+
* DIAL sinks for the picker (see `requestSink`) and for a page's availability. `source` announces their changes (as
|
|
106
|
+
* `deviceChanged`); `available` lists the sinks that have the app for a page at `origin`; `monitor` makes the sink
|
|
107
|
+
* service find out, until the returned function is called.
|
|
108
|
+
*/
|
|
109
|
+
dial?: {
|
|
110
|
+
source: DeviceSource;
|
|
111
|
+
available(appName: string, origin: string): CastDevice[];
|
|
112
|
+
monitor(appName: string, origin: string): (() => void) | null;
|
|
113
|
+
};
|
|
114
|
+
/** Adding a device by address, as Chrome's access code casting adds one; off unless `enabled` (see {@link AccessCodeOptions}). */
|
|
115
|
+
accessCode?: AccessCodeOptions;
|
|
116
|
+
/** Network changes, which the sinks and the devices added by address follow (Chrome: `DiscoveryNetworkMonitor`). */
|
|
117
|
+
networkMonitor?: NetworkMonitor;
|
|
118
|
+
/**
|
|
119
|
+
* True for a session another local activity of this app holds (a mirroring route, or a device it is launching one on),
|
|
120
|
+
* so it is not reported as a non-local route (Chrome: `CastActivityManager` adds a non-local activity only for a
|
|
121
|
+
* session no local activity has).
|
|
122
|
+
*/
|
|
123
|
+
ownsSession?(sessionId: string, sinkId: string): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* A session was launched for `senderId` (`CastActivityManager::DoLaunchSession`, where a route from the frame is
|
|
126
|
+
* recorded in `routes_by_frame_`). Not called for a join, which Chrome does not record there.
|
|
127
|
+
*/
|
|
128
|
+
onSessionLaunched?(senderId: number): void;
|
|
70
129
|
}
|
|
71
130
|
/**
|
|
72
131
|
* Main-process cast session manager: tracks initialized senders, one client per
|
|
@@ -76,11 +135,57 @@ export declare class CastSessionService {
|
|
|
76
135
|
private readonly options;
|
|
77
136
|
private readonly senders;
|
|
78
137
|
private readonly sessions;
|
|
79
|
-
private readonly
|
|
138
|
+
private readonly sessionListeners;
|
|
139
|
+
private readonly sinks;
|
|
140
|
+
/** The devices with an open channel; the only devices the service offers or casts to. */
|
|
141
|
+
private readonly sinkService;
|
|
142
|
+
private readonly tracker;
|
|
143
|
+
private readonly accessCode;
|
|
144
|
+
private lastRoutesKey;
|
|
145
|
+
/** Devices a page's launch is in flight on, with how many: the session it starts is the page's, not a non-local one. */
|
|
146
|
+
private readonly launching;
|
|
80
147
|
private readonly pendingRequests;
|
|
81
148
|
private readonly deviceListener;
|
|
149
|
+
/** Which sinks have which apps, asked over their open channels (Chrome: CastAppDiscoveryServiceImpl). */
|
|
150
|
+
private readonly appDiscovery;
|
|
151
|
+
/** The availability observations that follow the DIAL sinks (see `watchDialSinks`). */
|
|
152
|
+
private readonly dialWatchers;
|
|
153
|
+
private readonly onDialSinks;
|
|
82
154
|
private disposed;
|
|
155
|
+
private readonly unobserveNetwork;
|
|
83
156
|
constructor(options: CastSessionServiceOptions);
|
|
157
|
+
/** The devices that can be cast to: those with an open, authenticated channel (as Chrome lists sinks). */
|
|
158
|
+
devices(): CastDevice[];
|
|
159
|
+
/** The devices as a {@link DeviceSource}: what `devices()` lists, with the events of that list changing. */
|
|
160
|
+
deviceSource(): DeviceSource;
|
|
161
|
+
/**
|
|
162
|
+
* Open channels to the discovered devices that have none now, without Chrome's random delay, and ask the sinks again
|
|
163
|
+
* about the apps being observed, by the refresh rules (`CastMediaRouteProvider::DiscoverSinksNow` ->
|
|
164
|
+
* `CastAppDiscoveryServiceImpl::Refresh`).
|
|
165
|
+
*/
|
|
166
|
+
discoverSinksNow(): void;
|
|
167
|
+
/**
|
|
168
|
+
* The client of the device's open channel, which every activity on the device shares (Chrome: one `CastSocket` per
|
|
169
|
+
* sink, used by `CastMessageHandler` for every session); undefined when the device is not a sink now.
|
|
170
|
+
*/
|
|
171
|
+
channelClient(deviceId: string): CastClientLike | undefined;
|
|
172
|
+
/** Resolves when no channel is being opened and none is scheduled to be; for tests. */
|
|
173
|
+
settled(options?: {
|
|
174
|
+
retries?: boolean;
|
|
175
|
+
}): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Add a device whose address the app knows, as Chrome adds the one an access code resolved to: a channel is opened and
|
|
178
|
+
* the device is listed like any other, remembered for `accessCode.deviceDuration`, then removed. Rejects with
|
|
179
|
+
* `AccessCodeCastDisabledError` unless access code casting is enabled.
|
|
180
|
+
*/
|
|
181
|
+
addSinkByAddress(device: AccessCodeDevice): Promise<AddSinkResult>;
|
|
182
|
+
/** Change `enabled` and `deviceDuration` while running, as Chrome applies its policies. */
|
|
183
|
+
configureAccessCode(settings: {
|
|
184
|
+
enabled?: boolean;
|
|
185
|
+
deviceDuration?: number;
|
|
186
|
+
}): Promise<void>;
|
|
187
|
+
/** The devices added by address that are remembered now. */
|
|
188
|
+
rememberedSinks(): AccessCodeRememberedSink[];
|
|
84
189
|
/** Handle one bridge call; never throws or rejects. */
|
|
85
190
|
handle(sender: SenderInfo, method: string, params: unknown): Promise<BridgeResult>;
|
|
86
191
|
/** Detach a sender that went away: cancel its pending request, leave its sessions, drop its bookkeeping. */
|
|
@@ -95,8 +200,60 @@ export declare class CastSessionService {
|
|
|
95
200
|
private forgetSender;
|
|
96
201
|
/** Unsubscribe, close every client and clear all state. */
|
|
97
202
|
dispose(): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* What the device said about the app (`GET_APP_AVAILABILITY`), or undefined when it has to be asked: never asked, no
|
|
205
|
+
* answer last time, or "unavailable" longer than `APP_AVAILABILITY_REFRESH_MS` ago. This is
|
|
206
|
+
* CastAppDiscoveryServiceImpl::ShouldRefreshAppAvailability: kAvailable is kept, kUnavailable is asked again after
|
|
207
|
+
* kRefreshThreshold, kUnknown always.
|
|
208
|
+
*/
|
|
209
|
+
cachedAppAvailability(device: CastDevice, appId: string): boolean | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Ask the device whether it has the app (`GET_APP_AVAILABILITY`) unless a still-valid answer is cached. An error or
|
|
212
|
+
* no answer is not cached (Chrome's kUnknown): this resolves false, and the next call asks again. Callers that ask on
|
|
213
|
+
* every change (sinks observers) must pace themselves; see createSinksObservers.
|
|
214
|
+
*/
|
|
215
|
+
checkAppAvailability(device: CastDevice, appId: string): Promise<boolean>;
|
|
216
|
+
/**
|
|
217
|
+
* A page's `PresentationRequest` availability (`getAvailability()`), as Chrome serves it: a
|
|
218
|
+
* `PresentationMediaSinksObserver` on the source, fed by `CastAppDiscoveryServiceImpl::StartObservingMediaSinks`, so
|
|
219
|
+
* a sink counts once it has said over its open channel that it has the app (`GET_APP_AVAILABILITY`). With `dialApp`
|
|
220
|
+
* (a `cast-dial:` source of the same request) the DIAL sinks that have that app for the page's origin count too, as
|
|
221
|
+
* Blink ORs the sources of a request; the DIAL sink service is asked to find out while the observation lasts.
|
|
222
|
+
* `available` is the first answer: at once from the answers that stand, else once the Cast sinks asked have answered
|
|
223
|
+
* (a sink that says yes answers it at once). `onchange` is called after that only when the answer changes, as
|
|
224
|
+
* `PresentationMediaSinksObserver::OnSinksReceived` skips a repeated one. `close()` stops the observation
|
|
225
|
+
* (`StopObservingMediaSinks`). A disallowed origin is never available.
|
|
226
|
+
*/
|
|
227
|
+
observeAppAvailability(sender: SenderInfo, source: CastAppSource & {
|
|
228
|
+
dialApp?: string;
|
|
229
|
+
}, onchange: (available: boolean) => void): {
|
|
230
|
+
available: Promise<boolean>;
|
|
231
|
+
close(): void;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* One listener on the DIAL sinks for every availability observation: a page may hold many, and a listener each would
|
|
235
|
+
* trip EventEmitter's limit of ten.
|
|
236
|
+
*/
|
|
237
|
+
private watchDialSinks;
|
|
238
|
+
/**
|
|
239
|
+
* The sinks a request for an app is offered, as Chrome's dialog and `StartPresentation` offer the sinks of the
|
|
240
|
+
* source: those that have the app. Observes the source until `close()`, so the picker sees the list change; the
|
|
241
|
+
* first list is waited for when no answer stands yet.
|
|
242
|
+
*/
|
|
243
|
+
private appSinks;
|
|
98
244
|
private handleInitialize;
|
|
245
|
+
/**
|
|
246
|
+
* `requestSession`; with `presetDeviceId` (`requestSessionOnDevice`) the picker is skipped: that device is the choice
|
|
247
|
+
* (and must still be eligible). With `sink` (`requestSink`) the request may name a DIAL app as well as, or instead
|
|
248
|
+
* of, a Cast app, and the picker is offered the DIAL sinks that have it too; a DIAL choice is returned as
|
|
249
|
+
* `{ dialSink }` and nothing is launched here (the presentation handler creates the DIAL route).
|
|
250
|
+
*/
|
|
99
251
|
private handleRequestSession;
|
|
252
|
+
/**
|
|
253
|
+
* `checkOrigin` is joinSession's own rule (mode "chromecast", which is frozen and has no
|
|
254
|
+
* Chromium counterpart). Joining by id, as Chrome's Presentation API path does, has none: AppActivity::CanJoinSession checks only
|
|
255
|
+
* the app and that the client is not connected yet.
|
|
256
|
+
*/
|
|
100
257
|
private handleJoinSession;
|
|
101
258
|
private handleSendMessage;
|
|
102
259
|
private handleStopSession;
|
|
@@ -112,11 +269,21 @@ export declare class CastSessionService {
|
|
|
112
269
|
private handleLeaveSession;
|
|
113
270
|
private handleSetVolume;
|
|
114
271
|
private handleSetMuted;
|
|
115
|
-
/**
|
|
272
|
+
/**
|
|
273
|
+
* Join a session by its id, as Chrome's Media Router does for `reconnect("cast-session_<id>")`. A session this
|
|
274
|
+
* service already holds is joined without an origin check, like one found on a device. Otherwise the id is looked up
|
|
275
|
+
* in the session tracker, which knows what every device with an open channel runs: Chrome's CastActivityManager adds
|
|
276
|
+
* a non-local activity for each session its CastSessionTracker learns (AddNonLocalActivity) and
|
|
277
|
+
* FindActivityForSessionJoin finds it by id alone; auto-join skips it and no origin is checked. `appId`, when given,
|
|
278
|
+
* must be the session's app (AppActivity::CanJoinSession). Joining makes the route local, as in Chrome.
|
|
279
|
+
*/
|
|
280
|
+
private handleJoinRunningSession;
|
|
281
|
+
/** Launch the app on the device's open channel and register the session. */
|
|
116
282
|
private openSession;
|
|
283
|
+
private launchOn;
|
|
117
284
|
/** Remove a sender from a session; when it was the last one, tear the session down. */
|
|
118
285
|
private leave;
|
|
119
|
-
/** Subscribe to a freshly
|
|
286
|
+
/** Subscribe to a freshly opened channel's events. */
|
|
120
287
|
private bindClient;
|
|
121
288
|
private onClientMessage;
|
|
122
289
|
private onClientStatus;
|
|
@@ -124,10 +291,58 @@ export declare class CastSessionService {
|
|
|
124
291
|
private onClientClose;
|
|
125
292
|
/** Re-check availability for every initialized sender; emit only on change. */
|
|
126
293
|
private onDevicesChanged;
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
|
|
294
|
+
/** The sessions `senderId` launched and that still run (`routes_by_frame_` lookup by frame). */
|
|
295
|
+
sessionsLaunchedBy(senderId: number): string[];
|
|
296
|
+
/**
|
|
297
|
+
* Every live session, parked ones included, then the sessions the devices run that this service does not hold
|
|
298
|
+
* (started elsewhere, or let go of here), as Chrome's non-local routes.
|
|
299
|
+
*/
|
|
300
|
+
mediaRoutes(): MediaRoute[];
|
|
301
|
+
/** The tracked sessions no page of this service holds (Chrome: activities with `is_local` false). */
|
|
302
|
+
private nonLocalSessions;
|
|
303
|
+
/** Be told when a session starts, changes (status, volume, pages) or ends; returns the unsubscribe function. */
|
|
304
|
+
observeSessions(listener: () => void): () => void;
|
|
305
|
+
/**
|
|
306
|
+
* Stop a session on the device for every page, as if a member had called stopSession. A session this service does not
|
|
307
|
+
* hold is stopped on its device as it is (Chrome's TerminateSession works on non-local activities too).
|
|
308
|
+
*/
|
|
309
|
+
terminateSession(sessionId: string): Promise<BridgeResult>;
|
|
310
|
+
setSessionVolume(sessionId: string, volume: {
|
|
311
|
+
level: number;
|
|
312
|
+
} | {
|
|
313
|
+
muted: boolean;
|
|
314
|
+
}): Promise<BridgeResult>;
|
|
315
|
+
/**
|
|
316
|
+
* Every receiver status that describes a session, changed or not, with its volume (the tracker's
|
|
317
|
+
* `OnSessionAddedOrUpdated`); for the media controller. Returns the unsubscribe function.
|
|
318
|
+
*/
|
|
319
|
+
observeSessionStatus(listener: (sessionId: string, volume: ReceiverVolume) => void): () => void;
|
|
320
|
+
/**
|
|
321
|
+
* Every MEDIA_STATUS on a device's channel, credited to the session the device runs and merged with the media saved
|
|
322
|
+
* before (`CastSessionTracker::HandleMediaStatusMessage`); for the media controller. Returns the unsubscribe function.
|
|
323
|
+
*/
|
|
324
|
+
observeMediaStatus(listener: (sessionId: string, message: Record<string, unknown>) => void): () => void;
|
|
325
|
+
/**
|
|
326
|
+
* Send a message to a session's receiver app from main, with no page involved, over the device's channel. A session
|
|
327
|
+
* this service does not hold is reached too, as Chrome's `CastMessageHandler::SendMediaRequest` reaches a non-local
|
|
328
|
+
* activity's session: a virtual connection to its transport is opened first (`SendCastMessageToSocket` -> `DoEnsureConnection`).
|
|
329
|
+
*/
|
|
330
|
+
sendSessionMessage(sessionId: string, namespace: string, message: string): BridgeResult;
|
|
331
|
+
/** The volume the receiver last reported for a session, local or not (Chrome: `receiver.volume` of the CastSession). */
|
|
332
|
+
sessionVolume(sessionId: string): ReceiverVolume | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Detach every page from the session and close its transport; the receiver app keeps running (and is then listed as a
|
|
335
|
+
* non-local route). A route no page holds has nothing to detach.
|
|
336
|
+
*/
|
|
337
|
+
detachSession(sessionId: string): BridgeResult;
|
|
338
|
+
/** Tell the route observers something changed (the arguments only fit the ObservedMap callback). */
|
|
339
|
+
private notifySession;
|
|
340
|
+
/** The tracker learned something; route observers hear of it only if the routes they see differ now. */
|
|
341
|
+
private onTrackerChanged;
|
|
342
|
+
private fireSessionListeners;
|
|
343
|
+
private routeOf;
|
|
344
|
+
/** Chrome's `AddNonLocalActivity`: the route has no page, and its description is the session's (`GetRouteDescription`). */
|
|
345
|
+
private nonLocalRouteOf;
|
|
131
346
|
private snapshotOf;
|
|
132
347
|
private emitTo;
|
|
133
348
|
}
|