3Speak - Ecency integration - upload_info api with open source sample code

27

  • 233
  • 3
  • 25.252
  • Reply

  • Open in the desktop app ADD TO PLAYLIST

    sagarkothari88

    Published on Mar 28, 2023
    About :

    Hello Team Ecency,

    With this Video, I'll explain followings

    • video upload with TUS
    • thumbnail upload with TUS
    • consume upload_info API

    Where to find source code?

    EndPoints

    const studioEndPoint = "https://studio.3speak.tv";
    const tusEndPoint = "https://uploads.3speak.tv/files/";
    

    Code snippet for upload_info

     async function updateVideoInfo(
        oFilename,
        videoUrl,
        thumbnailUrl,
      ) {
        try {
          const { data } = await axios.post(
            `${studioEndPoint}/mobile/api/upload_info`,
            {
              filename: videoUrl,
              oFilename: oFilename,
              size: 9609313, // NOTE: please change (in bytes)
              duration: 40, // NOTE: please change (seconds)
              thumbnail: thumbnailUrl, 
              owner: username,
              isReel: false, // if video is a reel/3shorts
            },
            {
              withCredentials: false,
              headers: {
                "Content-Type": "application/json",
                "Authorization": `Bearer ${accessToken}`,
              },
            }
          );
          return data;
        } catch (e) {
          console.error(e);
          throw e;
        }
      }
    

    Code snippet for getting status of all videos of a user

      async function getAllVideoStatuses(access_token) {
        try {
          let response = await client.get(
            `${studioEndPoint}/mobile/api/my-videos`,
            {
              withCredentials: false,
              headers: {
                "Content-Type": "application/json",
                Authorization: `Bearer ${access_token}`,
              },
            }
          );
          return response.data;
        } catch (err) {
          console.log(err);
          throw err;
        }
      }
    

    Why here?

    • We are building open source code base.
    • I think, with this video, I can help more users who wants to integrate APIs
    • More clients can integrate with Spknetwork

    More Queries

    • Please reach out to me in discord 3Speak server
    • Or Add comment below the post

    Support Me

    Please 🙏Support Me
    Donate Hive Or HBD Vote me as Hive Witness

    Other Communities

    I recommend joining these communities on Hive & Discord.


    Click on the banner to join

    Click on the banner to join


    Important 3Speak Links

    3Speak.tv3Speak Twitter3Speak Hive3Speak Telegram
    3Speak in SpanishDownload Android AppDownload iOS AppDownload Desktop App
    Join 3Speak DiscordSetup Encoder NodeVote for 3Speak ProposalVote 3Speak as Witness

    Cheers
    Have a good one

    Tags :

    india neoxion leofinance aliveandthriving alive pob ctp ecency upmewhale

    Woo! This creator can upvote comments using 3speak's stake today because they are a top performing creator! Leave a quality comment relating to their content and you could receive an upvote worth at least a dollar.

    Their limit for today is $0!
    Comments:
    Time until sagarkothari88 can give away $0 to their commenters.
    0 Days 0 Hours 0 Minutes 0 Seconds
    Reply:

    To comment on this video please connect a HIVE account to your profile: Connect HIVE Account

    More Videos

    12:52
    5 views 3 years ago $
    01:00
    0 views 2 years ago $
    02:34
    24 views 3 months ago $