https://discord.cloudflare.com logo
Join Discord
Powered by
# stream
  • j

    joshh

    08/31/2022, 2:49 AM
    it's been annoying me for a week
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:49 AM
    I know, trust me when I did a project with Stream a few weeks ago I was super stuck
  • j

    joshh

    08/31/2022, 2:49 AM
    LEEEEEEETSSSSSSSSSSSSSSSSSSSS GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:49 AM
    The issue was that I was sending the video length in minutes in my
    upload-length
    , but the error was very strange and I didn't figure it out for hours
  • j

    joshh

    08/31/2022, 2:50 AM
    yeah..cf really needs work on documentation and errors.
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:50 AM
    Yeah...
  • j

    joshh

    08/31/2022, 2:50 AM
    thanks for the help 😄
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:50 AM
    No problem 😄
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:50 AM
    I'll PR the docs tomorrow with a little note about this, since you're probably not the only one to run into it.
  • j

    joshh

    08/31/2022, 2:50 AM
    are you sure Stream requires base64 encoding for creatorIDs?
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:50 AM
    Yeah, pretty sure.
  • j

    joshh

    08/31/2022, 2:50 AM
    Stream doesnt seem to like that
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:51 AM
    Oh, huh...
  • j

    joshh

    08/31/2022, 2:51 AM
    so it gets the "require signed URLs" but not the creator id
  • j

    joshh

    08/31/2022, 2:51 AM
  • j

    joshh

    08/31/2022, 2:52 AM
    Copy code
    const response = await fetch(
                'https://api.cloudflare.com/client/v4/accounts/165741ddf22256f1c2d442e345765203/stream?direct_user=true',
                {
                    method: 'POST',
                    headers: {
                        'Authorization': `Bearer ${env.StreamReadWriteAPIKey}`,
                        'Tus-Resumable': '1.0.0',
                        'Upload-Length': size,
                        'Upload-Metadata': `creator ${btoa(profileData.id)},requiresignedurls`,
                    },
                    data: JSON.stringify({ requireSignedURLs: true, allowedOrigins: ["motionfans.com"] })
                }
                )
  • j

    joshh

    08/31/2022, 2:52 AM
    oh
  • j

    joshh

    08/31/2022, 2:52 AM
    wait
  • j

    joshh

    08/31/2022, 2:52 AM
    I just saw it
  • j

    joshh

    08/31/2022, 2:52 AM
    lmao
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:52 AM
    What was it?
  • j

    joshh

    08/31/2022, 2:52 AM
    it's picking up the "requireSignedURLs" because it's in the POST body there
  • j

    joshh

    08/31/2022, 2:53 AM
    I'll try adding the creator param
  • j

    joshh

    08/31/2022, 2:53 AM
    see if that works
  • j

    joshh

    08/31/2022, 2:53 AM
    1 moment
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:53 AM
    K
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:53 AM
    I'd guess that it's picking up the requireSignedUploads from the header not the body since the allowedOrigins isn't being picked up from the body.
  • j

    joshh

    08/31/2022, 2:54 AM
    yeah
  • j

    joshh

    08/31/2022, 2:54 AM
    that seems to be it
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:54 AM
    It worked?
1...373839...105Latest