Embedding a Video Player in Next.js with Next Cloudinary - Dev Hints

Sdílet
Vložit
  • čas přidán 10. 04. 2023
  • Play and embed videos in a Next.js app using the CldVideoPlayer from Next Cloudinary.
    We'll walk through importing and configuring the CldVideoPlayer to play a video from a Cloudinary account and how to customize the look and feel with custom colors.
    📝 Next Cloudinary Docs - CldVideoPlayer
    next-cloudinary.spacejelly.de...
    💾 Embedding Video with CldVideoPlayer
    github.com/colbyfayock/cloudi...
    Instructor: Lazar Nikolov ( @nikolovlazar )
    --
    Cloudinary helps developers build performant experiences for the web with powerful optimization and transformation APIs.
    🚀 Get started with a free account!
    cld.media/devhintsnextcldvide...
    #cloudinary #devhints #nextjs #video #videoplayer #webdevelopment
  • Věda a technologie

Komentáře • 18

  • @derusmares9508
    @derusmares9508 Před 2 měsíci

    How would you create the play pause functionality + const without running into the "cant render client components into server components"?

    • @colbyfayock
      @colbyfayock Před měsícem

      hey im not totally sure what you mean by the play pause functionallity + const, but, in order to use the player in a server component, you can either apply the "use client" directive to the top of the page/component or create a light wrapper component that includes that directive and passes all the props through, similar to this example: next.cloudinary.dev/nextjs-14

  • @printingfinger
    @printingfinger Před 8 měsíci

    You saved my job 😅
    Thanks ❤❤❤❤❤

  • @tonyabracadabra6935
    @tonyabracadabra6935 Před 9 měsíci

    How to setup autoplay for it? I can't find any documentation regarding the value for autoplay field!

    • @colbyfayock
      @colbyfayock Před 9 měsíci

      you should be able to pass in autoPlay="always" but there may be a bug per another comment, will work on getting that fixed!

  • @jnem84
    @jnem84 Před 9 měsíci

    I can’t get my video to auto play. I’ve tried adding autoPlay=“always” but nothing happens. Am I doing something wrong?

    • @colbyfayock
      @colbyfayock Před 9 měsíci

      mentioned in the other video, might be a bug, would be great if you could file an issue here: github.com/colbyfayock/next-cloudinary/issues

    • @colbyfayock
      @colbyfayock Před 9 měsíci

      hey actually realizing this is likely not a bug. do you have the `muted` prop also added? most browsers will not autoplay unless the video sound is turned off to avoid interrupting people browsing a site. so if you have it should work for you

  • @MandelaoDigital
    @MandelaoDigital Před rokem

    not working on v16
    Error: (0 , c.useRef) is not a function

    • @colbyfayock
      @colbyfayock Před rokem +2

      you need to add "use client"; to the top of the file where you're using it if you're using React Server Components. to avoid making an entire page a client component, you could wrap this component in a client component first. unfortunately there's not a great way to handle opting individual components in a library as client components right now

    • @derusmares9508
      @derusmares9508 Před 2 měsíci

      ​@@colbyfayock what would be a "better way"?

    • @colbyfayock
      @colbyfayock Před 2 měsíci

      @@derusmares9508 on the tooling side i need to figure out how to maintain "use client" in the exported module so that the person trying to use it doesn't have to. ive had trouble trying to get that working with my current build system, but will be exploring other options. The docs here have an example of how you can create your own wrapper: next.cloudinary.dev/nextjs-14

  • @adamorbarbosadebarrosneto4690

    i can use youtube link in src?

    • @colbyfayock
      @colbyfayock Před 3 dny

      i dont think so, though i think you can use direct file links, such as msite.com/file.mp4, but the player is really designed to be used with Cloudinary

  • @kacperkepinski4990
    @kacperkepinski4990 Před 4 měsíci

    local video......

    • @colbyfayock
      @colbyfayock Před 4 měsíci

      hey can you clarify? are you hitting an issue?