What's your most unique/offbeat/weird use of "app-message" events or data channels?

Lazer
Lazer Dailynista

I've recently used Daily's "app-message" events to make a small demo of a cursor sharing implementation, which made me think about other creative use cases for this kind of client-side event.

I'm curious about others' unique use cases of either "app-message" or just data channels. What was the most offbeat or cool thing you've used this kind of client-side data transmission for? (I say "client-side" knowing that "app-message" isn't exactly totally client side under the hood, but as far as the end user implementation is concerned one doesn't need their own server component.)

Was it in a production level use case or just some kind of creative coding exercise? Doesn't have to be something you actually implemented either, could just be an idea or something you think might be cool to see/try.

Comments

  • kwindla
    kwindla Community Manager, Dailynista admin

    My favorite use of app-message is controlling clients that display video calls on big TV screens.

    I've written a few custom clients that let me join calls on a big screen, and I can control the call state and layout on the big screen from another client running on my phone or laptop.

  • Some funny stuff i did was share a youtube video through the data channel. Play, pause and update the position of the video were features of this functionality. The big problem that i never solved was the autoplay of the video for the remote participants. Browser locked the autoplay so i had to render a little message that it said, please "play the video to synchronize" , it was a lie xD, the browser just needed that the user click the screen. Some knows how to pass the autoplay correctly?

  • Lazer
    Lazer Dailynista
    edited December 2022

    @isra ooh that sounds like a super interesting use case, thanks for sharing.

    Re autoplay... I feel your pain. I've dealt with this a bit in some of my demos and mentioned it in my track handling post here as well: https://www.daily.co/blog/working-with-video-call-participants-media-tracks-for-fun-and-profit/#browser-autoplay-considerations

    One thing that can help is ensuring the video is muted. Video that has no audio is usually not blocked by browsers afaik. However I had some weird behavior on Safari in my case, and ended up going with a solution that sounds similar to yours in prompting the user to make a gesture. I removed autoplay altogether in my demo implementation. There's my PR for that with an explanation: https://github.com/daily-demos/modern-wordfare/pull/23

    Basically, what I ended up doing is explicitly calling play() instead if the video isn't already playing. This then let me catch a NotAllowedError, which is what you get if a browser blocks autoplay. Then if this error is detected, I'd ask the user to click a button to play (and call play() again).

    I wonder if either splitting the video and audio tracks into separate DOM elements or muting the video until a gesture is made could work with autoplay in your implementation...