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

    joshh

    08/31/2022, 2:36 AM
    ok cool, how can I encode the time into base 64 on workers?
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:37 AM
    btoa
    should work.
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:38 AM
    Example
    Copy code
    js
    "upload-metadata": `creator ${btoa(userID)}`
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:38 AM
    And now that I look at my project I'm realizing that maxDurationSeconds must not be required since I'm not using it
  • j

    joshh

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

    joshh

    08/31/2022, 2:39 AM
    all good
  • j

    joshh

    08/31/2022, 2:40 AM
    so, the size goes both in the ``Upload-Length`` and ``Upload-Metadata`` headers?
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:41 AM
    The
    Upload-Metadata
    is the video length as in time, which is a bit harder to get. But you shouldn't need that.
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:42 AM
    I'm guessing what was messing Stream up was your empty
    Upload-Metadata
    header.
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:42 AM
    So if you move the allowedOrigins and requireSignedUrls to
    Upload-Metadata
    and omit maxUploadSeconds it should work
  • j

    joshh

    08/31/2022, 2:45 AM
    Tus isn't current printing the % of the upload to console
  • j

    joshh

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

    joshh

    08/31/2022, 2:45 AM
    here's the issue
  • j

    joshh

    08/31/2022, 2:45 AM
    also, that video didnt get any metadata
  • j

    joshh

    08/31/2022, 2:45 AM
    and Stream thinks it's 200 minutes
  • j

    joshh

    08/31/2022, 2:45 AM
    as it thought all the others were 200 minutes
  • j

    joshh

    08/31/2022, 2:45 AM
    which is weird
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:47 AM
    Sec, think I just realized your issue
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:47 AM
    Indeed, found it!
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:47 AM
    So the
    endpoint
    is only if you want TUS to do the request to get the URL for you, which you don't on Stream
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:47 AM
    Instead you need to use
    uploadUrl
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:48 AM
    (same client, just replace
    endpoint
    with
    uploadUrl
    )
  • j

    joshh

    08/31/2022, 2:48 AM
    you have no idea what a legend you are
  • j

    joshh

    08/31/2022, 2:48 AM
    I've been debugging this for a week
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:48 AM
    I'd also recommend specifying a bigger chunk size like
    chunkSize: 5_242_880
    if you want faster uploads.
  • j

    joshh

    08/31/2022, 2:48 AM
    you absolute legend
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:48 AM
    Oh wow! Glad we got it working then 😄
  • j

    joshh

    08/31/2022, 2:48 AM
    well not like constantly
  • j

    joshh

    08/31/2022, 2:48 AM
    but yk
  • i

    Isaac McFadyen | YYZ01

    08/31/2022, 2:48 AM
    Yeah 🙂
1...363738...105Latest