Coder Social home page Coder Social logo

Comments (6)

avayvod avatar avayvod commented on June 11, 2024

I'm not even sure what a "callback device" is in the question.

A callback is basically a Javascript function that can be called by the user agent. A numeric identifier is needed to be able to unregister the callback for cleanup. In Chrome we just find the next integer that's not assigned to any previously registered callback that hasn't been cancelled yet. I'd be wary putting this into an algorithm as it may restrict other user agents in their implementation and worse make web pages depend on the order of ids or something.

We can add a note that the identifier MUST not leak any privacy information, however I doubt that's very helpful.

from remote-playback.

mfoltzgoogle avatar mfoltzgoogle commented on June 11, 2024

My reading was that "Callback device" is the device triggering the callback, e.g. a newly discovered remote playback device.

from remote-playback.

mfoltzgoogle avatar mfoltzgoogle commented on June 11, 2024

I think a note clarifying the id generation mechanism would address this concern. I can propose a PR.

from remote-playback.

avayvod avatar avayvod commented on June 11, 2024

The id is returned way before any device is found (at least in the simple use case when availability starts as a result of watchAvailability). When the device is found, the callback is fired with a single boolean argument and its id doesn't change.
Clarifying the id generation would probably help eliminate confusion though I agree.

from remote-playback.

avayvod avatar avayvod commented on June 11, 2024

As a follow up on the PR #83, we might want to spec the uniqueness of the id (e.g. within a frame) so that web authors could rely on the behavior suggested by the example.

from remote-playback.

mfoltzgoogle avatar mfoltzgoogle commented on June 11, 2024

Closing as I believe this is addressed by the PR.

from remote-playback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.