Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop parameter not working in HTML5 player #24

Open
michalhudecek opened this issue Jan 17, 2018 · 7 comments
Open

Loop parameter not working in HTML5 player #24

michalhudecek opened this issue Jan 17, 2018 · 7 comments

Comments

@michalhudecek
Copy link
Contributor

To make loop working in embed videos, the playlist parameter has to be set to the same youtube video.

See loop in https://developers.google.com/youtube/player_parameters

Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. 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:

@michalhudecek michalhudecek changed the title How to set a playlist? Loop parameter not working in HTML5 player Feb 7, 2018
@michalhudecek
Copy link
Contributor Author

There is an easy fix for this issue. I wanted to create a pull request but looks like I don't have permissions. Here is the code that needs to be added to classes/Twig/YoutubeTwigExtension.php on line 56

//YouTube loop fix for HTML5 player
if ($key == 'loop' && $value == 1) {
    $filtered_player_parameters['playlist'] = $video_id;
}

@DerTFL
Copy link

DerTFL commented Feb 16, 2018

michalhudecek, Thanks! All work now.

@michalhudecek
Copy link
Contributor Author

This should be a very easy pull request. Any fix in sight?

@rhukster
Copy link
Member

Anyone can create a pull request, you can simply navigate to the file in github and click edit. Then when you save it automatically creates a pull request.

michalhudecek added a commit to michalhudecek/grav-plugin-youtube that referenced this issue Sep 11, 2020
In order to play a single video in a loop, a playlist parameter with the same videoID has to be passed as described in getgrav#24

This is official solution described in YouTube Docs: https://developers.google.com/youtube/player_parameters#loop
@michalhudecek
Copy link
Contributor Author

Oh. Ok. I tried to do it directly from git without success. Here it is: #36

@mahagr
Copy link
Member

mahagr commented Sep 14, 2020

Looks like this one can be closed now?

@michalhudecek
Copy link
Contributor Author

Was it released to production?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants