Youtube full iframe player with no cookies - Can it be done? - iframe

I am trying to create a page with a standard youtube iframe player. It will play a video and when the first video finishes, it will use loadVideoById to load and play a second, and then after it finishes a third video.
The problem I have is that since I have partially watched the second (and third) video while signed into my youtube account, when the second (and third) video plays, it picks up from where I left off watching it on youtube, instead of starting from the beginning, and I don't want this to happen to anyone else who visits the site.
If I open the page in an incognito window it works as expected, so I know my code is good. If I just use an iframe and embed the video using youtube-nocookie.com as the domain (instead of just youtube.com) the videos start from the beginning. I could get away with using this method except I can seem to detect when the first video ends so I can change the iframe's source to start the next video.
I'm looking for any advice on either being able to detect when a youtube video ends in an iframe, or a way of using the full player with no cookies, or something (anything) else that will accomplish this task.

Related

Wordpress audio playlist skipping tracks

I have an audio playlist in a Wordpress site. When I'm playing the tracks, if the playback of the track catches up with the download of the track, instead of pausing or buffering, it just skips to the next track.
Is there a way I can stop it doing that and instead just let it pause the playback while the download continues?
When I'm on a fast internet connection, it works fine, but when I'm on (for example) my phone, it can't download as fast. I get a diagonal stripe on the replay control, and then it just skips to the next track.
If there's not a convenient setting that works here, maybe there's a way I can put a small delay in the playback of each track to enable the download to get a head start?
Many thanks in advance.

YouTube iframe looping video unavailable on first load

I embed a video on a Blazor-powered static page. I want the video to loop. According to docs (https://developers.google.com/youtube/player_parameters#loop), I need to have both loop and playlist params. Easy enough.
So I generate URL like this: https://www.youtube-nocookie.com/embed/tFbVZCbLhOk?autoplay=1&loop=1&modestbranding=1&disablekb=1&playsinline=1&rel=0&fs=0&playlist=tFbVZCbLhOk&controls=1&origin=http://localhost:5134 - as you can see, loop is set to 1, and playlist is set to the same video itself tFbVZCbLhOk.
The problem I am having is that when the video is embedded (or the link is accessed directly - the issue occurs there as well), it errors with This video is unavailable. Refreshing the page fixes that, however it of course is less than perfect. I am not sure what causes this, as some videos appear to randomly work on first attempt - but it's inconsistent, cause the same video might fail other time.
Removing the playlist param fixes the issue, but then the video doesn't loop properly, which is even worse for my use case.
I am not sure if it's a regression on YouTube's side, as a month or two ago, I did not have that issue - I think so at least.
It also seems like it's not bound to the tab or anything like that - when I open video once, next time I open it on a separate tab, it works - almost like if YT took its sweet time to create playlist for the video, but that's just my guess
I tried your video sample (i.e. tFbVZCbLhOk) and with the following code (which I modified from this answer), and the looping of the video works fine:
https://www.youtube.com/embed/tFbVZCbLhOk?enablejsapi=1&loop=1&playlist=tFbVZCbLhOk&autoplay=1&rel=0&showinfo=0&color=white
Probably what you're describing is another YouTube undocumented change.
<iframe onload="this.src+='';this.onload='';"
This reload once the iframe and after that it stops. I hope it will help you.

&ytp-pause-overlay=0 no longer works

I am trying to get rid of the More Videos section on a you tube iframe player when you pause a video. Everything I can see online says you need to add &ytp-pause-overlay=0 to the URL. That does not do anything. How do I get rid of that section when you pause a video. It is hiding the exact thing I want my users to see.

Play video from an intermediate point

I am in the middle of an application that has a module to play videos from a directory on the same web-server. Everything is fine, except for the point that, while video is streaming, if I try to drag the player tip to an intermediate point, it either drags back to where it was(in flex player) or keeps loading un-till the video actually approaches that point(in case of jw-player or html5 player) or does nothing(in some other online players available). My client wants to be able to play or start buffering from any desirable point. I read something about RTMP to be used for such thing, but wasnt able to find a direct guide over how to do it.
Help appreciated!
If you're talking about being able to load a video file from x seconds in to the video, you should look into http pseudo-streaming. Here's a link to the jwplayer page about it: jwplayer pseudo-streaming

Palm Pre not picking up embedded YouTube videos

I've embedded a YouTube video onto a site (built in drupal) using the embed code from the video's YouTube page.
If I visit that page on an iPhone, it picks up the fact that there is a YouTube video and displays the icon that you click to pop open the video and watch it.
If I visit the same page on a Palm Pre it just displays a blank space where the video should be. If I visit the video on the YouTube page itself, however, the Palm Pre picks up the fact that there is a video and allows you to open it.
I'm just wondering if anyone else has run into the same problem and has some insights they can offer. I'd love to have a more graceful solution than just adding a link to the YouTube page below the embedded player
Thanks!
You could compare the embed code actually used on the YouTube page (as opposed to the one they offer for quick copy & paste) with the one you are using, as there are quite some different ways to embed a video.
I would expect them to use the SWFObject for embedding, which is a tiny bit more effort to use on your page, but usually works a lot more reliable than the 'old fashioned' embed tag offered for quick copy&paste.
You might also try requesting the YouTube page faking the user agent of the Palm Pre, as they might deliver something different for those, but that is pretty unlikely.

Resources