Coder Social home page Coder Social logo

Looping a video about oembed HOT 6 CLOSED

holiday-jan avatar holiday-jan commented on September 1, 2024
Looping a video

from oembed.

Comments (6)

reganlawton avatar reganlawton commented on September 1, 2024

You can just add it to the params object and it'll add to the URL just like the loop

from oembed.

holiday-jan avatar holiday-jan commented on September 1, 2024

Ok, only the VIDEOID is dynamicly fetched from the URL in the oEmbed field. So is it possible to implement this in the plugin? Because each oEmbed field can have different URL's, or the given URL can change in the future.

from oembed.

reganlawton avatar reganlawton commented on September 1, 2024

What's the playlist you're trying? Or will any playlist be fine to test? I'll give it a go in the morning.

from oembed.

holiday-jan avatar holiday-jan commented on September 1, 2024

What's the playlist you're trying?

The same as the given VIDEOID, from the Google YouTube docs:

To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL: https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1

So when the URL in the oEmbed field is: https://youtu.be/Vol0KTIE2O8 or https://www.youtube.com/watch?v=Vol0KTIE2O8 and we render it with:
{{ video.render({ params: { autoplay: 1, controls: 0, mute: 1, loop: 1 } }) }}

We get:
<iframe width="200" height="113" src="https://www.youtube.com/embed/Vol0KTIE2O8?loop=1&amp;mute=1&amp;controls=0&amp;autoplay=1&amp;feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" title="Strandpark de Zeeuwse Kust film"></iframe>

We would also like the playlist param with the same [VIDEOID] as in the URL. In this example Vol0KTIE2O8, then it repeats over and over again ;), else it stops after 1 cycle.

Thank you in advance Regan! For support and spending your time

from oembed.

reganlawton avatar reganlawton commented on September 1, 2024

@holiday-jan Found issues with the src handling and also added support for the playlist when loop=1 is found

Give v3.0.7 a go and let me know it that works

from oembed.

holiday-jan avatar holiday-jan commented on September 1, 2024

Works perfectly! 👍

from oembed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.