I've been using the YouTube IFrame API to shuffle multiple of my playlists together. I've got a very bare-bones HTML page with a 'next' and 'previous' button, and a bunch of javascript that loads up and plays videos and handles the button events.
The general order of events when the script loads is
* Wait for page load
* Wait for iframe API to load
* Create player
* For each playlist in [my playlists]
* Cue Playlist
* Wait for event CUED
* Add all loaded videos to list of all videos
* Shuffle list of all videos
* Play the videos
This page worked just fine for all the playlists I regularly play until today. Suddenly, when loading specific playlists, I am no longer getting a CUED event (or any event, for that matter), it just hangs, waiting for the playlist to be cued; however, I can press the 'play' button on the iframe and play the first video in the playlist. Additionally, I don't get any events triggering the onError handler from the player; as far as I can tell, I get no feedback after calling cuePlaylist
The playlists in question are all personal playlists that are publicly available under my user.
Here's an example of a playlist that exhibits this behavior:
https://www.youtube.com/playlist?list=PLuh_GoPmqJB7ADc9_T0HtCQ1oQ3_rutjx
And here's an example of a playlist that does not; if I try to load this one, it works as expected (and as it did with the other playlist just yesterday):
https://www.youtube.com/playlist?list=PLuh_GoPmqJB7wclmbu-qicy5uLwnsTSHO
I wonder if maybe the issue is related to the content of the playlist; like it fails if one of the videos isn't allowed to be played in my country or something. But previously when that was the case, it would load just fine and then skip those videos during playback. I don't think the issue is related to the length of the playlist, because the working playlist example is significantly longer than the non-working one.
This issue appears to have resolved itself. I suspect it was a bug in the iframe api or maybe the youtube backend which has been fixed by the youtube engineers. So iframe team, if you see this, thanks!
Related
I'm embedding a video on my website from YouTube and I want it to loop. To do that I have to use the loop and playlist parameters. I do that and it generates a link like this: https://www.youtube.com/embed/MegurLP8PxI?playlist=MegurLP8PxI&autoplay=1&controls=0&rel=0&enablejsapi=1&start=312&loop=1&widgetid=55. So the loop parameter is set to 1 and the playlist is set to the video id MegurLP8PxI.
The issue is that when I initially load the video it shows the This video is unavailable error. Refreshing the page fixes that but that's not ideal. What makes it hard to understand what's wrong is that this only happens sometimes, seemingly at random. Happens with other videos too.
Another fix that I found is removing the playlist parameter from the url. However than the video will not loop, which I really need it to. Any help would be really appreciated.
When a YouTube video stops playing, related videos are often shown at the end in a grid (depending on the video owner's preference). I have an IFrame Player embedded on a web page that plays public YouTube videos. When a related videos at the end is clicked, a new page is opened playing the related video. I've scoured the API docs and although there doesn't seem to be a solution, I'm going to ask anyway in case I've missed something or some perspective. Is there an API setting that allows the video to play on the same iframe instead of opening a new page, or some solution that could be worked out?
The problem can be seen this page: http://ignitingthesixthsense.com/pre-launch-1
The issue is with the pluggin called Social Discount Press. The purpose of this pluggin is that it prompts the user to share your webpage via social media, and if they do so a link will then appear giving them access to restricted content.
There are actually 2 problems, but I am not sure if they stem from the same issue or not.
1) The first issue is that I have placed the social share buttons on the page twice using this shortcode:
[social_sharing_discount index="2"]
And the second instance of the share buttons (towards the bottom of the page) do not work properly. The Facebook and Twitter button activate the share box when clicked, but after sharing, the "instant access" button does not appear beneath the share button as it should. And the Google button does nothing at all when clicked. I have found that if I remove the 1st instance of the share buttons (at the top of the page), then the second instance of them starts working, so in other words it only seems to work properly if there is one instance on the page at a time.
2) The second and much much smaller issue, is that when the Google share button is clicked, the access button appears before the person actually shares.
And assistance with this would be greatly appreciated.
I have found that the main cause of the issue was due to the pluggin being built mainly on ID's which need to be unique across the page. And having multiple instances of the same ID was causing many errors.
The solution was to rewrite some of the php and js to use Classes instead of ID's. This allowed for two instances of the pluggin to work on the same page, thus solving problem number one.
The reason why the google one is so inaccurate is because the author simply opens up a popup to the google share page in a popup, this doesn't allow us to see the JS events such as when we share.
On the other hand because the twitter and facebook jssdk are loaded into the page, we know the exact moment when there has been either of those have been shared and thus accurately display the instant access button.
Due to this the author of the pluggin is just doing a best guess as to when the user is likely to have shared. It this case the author is guessing that when the javascript onunload event fires, that logically the user has shared on google. Now the onunload event can be fired in multiple ways, one is when the user closes the popup, i.e the best guess scenario as to if the user has shared. However the onunload event also fires when the form loses focus, a user naviagtes a way or a link is clicked.
Furthermore the onunload event is only properly supported in IE, FF and Safari, not Chrome and Opera. Which in the end gives it differeing behaviour in different browsers.
All of this can lead to unpredicatable behaviour, such as what you are noticing.
A better solution would be for google to have a jssdk for the the google plus share that let's us create a share box on the fly, however it's lacking that functionality as of now.
I need to track youtube video status.I need to check the video is played till the end or not.After clicking an play button,user has to see the video till the end. Depending upon this i need to issue a certificate to my user. For this task i need to track the status of youtue video. how can i do this in asp.net?
I doubt you can do it for certain, best I imagine you could do is with some Javascript, start an embedded youtube video playing (set it to autoplay and it will start as soon as the page has loaded), then start a timer in Javascript for the same length of time as the video takes to play.
If the time gets to the end, and the user is still on the page, then they might have watched the whole video. In which case you could make a call back to the server (Ajax or to a ashx handler) saying that is is complete. Then redirect the viewer to the certificate page.
You'll never know for certain as they could start teh video running then walk away to make coffee or something. And I doubt Youtube expose this data themselves (ie, did the end of the video play).
This can be done using Youtube Javascript API. Learn more at YouTube guide for dot net developers. Also see YouTube JavaScript Player API Reference and especially the section on event handlers.
I developed a band website using wordpress, and I placed a flash MP3 player that autoplays in the header. Whenever you click on a link, the entire page refreshes and the mp3 player starts playing the first song all over again. I wish to have the entire header including the mp3 player) stay constant while the content/sidebar/footer reloads when you click a link. That way the music will continue playing while the rest of the page loads, and the user can have a real listening experience.
To all of your knowledge, is there any way to do this without making the rest of the site completely dynamic?
Thanks in advance
There are acutally only two ways to do this without Ajax:
Use a frameset (which is a very bad idea nowadays)
Use a pop-up which holds the player
I know that pop-ups might be blocked, but this is the only way that users will accept. many large sites with audio players use pop-ups for such a functionality.