Why are YouTube videos using 'youtube.com/v' not loading - youtube

Please review this page.
The embedded video plays when the page is viewed on a mobile device but not when viewed on a computer (tested on two laptops running Windows 8 and 10, on Chrome, FF, and Edge).
This issue only exists with YouTube videos and the problem began 48 hours ago (approx.)
For example, see this YouTube URL (no video is being loaded):
http://www.youtube.com/v/RCsJHHUkisw&rel=0&color1=0x054b81&color2=0xe2e2e2&hd=1&showinfo=0&enablejsapi=1&playerapiid=ytplayer&fs=1

I have managed to handle this problem by rewriting the emvideo module.
I am currently using the module version = "6.x-1.26".
I didn’t take the time to change the entire module;
I changed only the parts I needed:
All the changes were made in this file:
\sites\all\modules\emfield\contrib\emvideo\providers\youtube.inc
In function theme_emvideo_youtube_flash line 444 I changed the line
$url = check_plain("http://www.youtube.com/v/$code&$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs");
to
$url = check_plain("https://www.youtube.com/embed/$code"); .
What I did was to look at the youtube embed code and try to make the link look the same.
Next step was to change the FLASH output, in line 566 function
theme_emvideo_youtube_default_external and change the next content:
<div id="$div_id">
<object type="application/x-shockwave-flash" height="$height" width="$width" data="$url" id="$id">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain"/>
<param name="quality" value="best"/>
<param name="allowFullScreen" value="$fullscreen_value"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="scale" value="noScale"/>
<param name="salign" value="TL"/>
<param name="FlashVars" value="$flashvars" />
<param name="wmode" value="transparent" />
</object>
</div>
To
<div id="$url"><iframe width="$width" height="$width" src="$url" frameborder="0" allowfullscreen></iframe></div>
And that’s all…
Hope it helps a bit…

The following should be pretty close to a drop-in replacement for what's currently being served on the page referenced in the question (the object tag with id emvideo-youtube-flash-2):
<iframe id="ytplayer" type="text/html" width="590" height="499"
src="https://www.youtube.com/embed/Je2vE5RLJ6o?rel=1&showinfo=0&enablejsapi=1&fs=1&origin=http://www.islandcricket.lk/"
frameborder="0" allowfullscreen>
A few things about the implementation currently being served:
Using object tag and the embed URLs of the form youtube.com/v/video id (which only serves a Flash player, not HTML5) to embed YouTube videos has been deprecated for over a year.
the player parameter hd is deprecated. The iFrame player (used in the above code), will automatically chose the best quality to display based on a variety of parameters. If you wish to control this you can use the Javascript API.
the rel, showinfo, enablejsapi and fs parameters should continue to function as they have in the previous implementation (parameter documentaion here)
The allowScriptAcess parameter set to sameDomain in the current implementation is replaced by the origin parameter and should be set to the URL severing the webpage (documented here)
Screenshot of the above code working on islandcricket.lk tested via webdev tools:

Related

Unicode characters in the URL param of Embedded Windows Media Player

Let's take this simple HTML:
<html>
<body>
<!-- Object Tag For the Audio Player -->
<object id="mpAudio" width="100%" height="100%"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject" align="middle">
<param name="URL" value="http://servername/media/Alt.TÉst/default.wav" />
<param name="AutoStart" value="True" />
<param name="UIMode" value="Full" />
<param name="EnableContextMenu" value="True" />
<param name="WindowlessVideo" value="True" />
<param name="Mute" value="False" />
</object>
</html>
Notice in the URL there is this unicode character: É
When I open that html file, the audio plays as a garbled mess. Of note, in some older VM I have (for random IE6 testing), which has an O/S of 2003 Standard Edition, an IE 6 browser, and Windows Media Player 6.4.09.1130 .. it works, fine! My testing where it's a garbled mess, involves Windows 7, IE 10, and WMP 12.0.7601.17514
I thought the solution may be % encoding the URL. That's even worse. The encode became: http%3A%2F%2Fservername%2Fmedia%2FAlt.T%C3%89st%2Fdefault.wav
And I went from at least being able to play a garbled mess, to not playing anything at all.
One other test:
Taking the non-encoded url and putting it in Firefox, opens the wav (so Firefox is OK with the unicode character). Taking the encoded url, I get "server not found". I guess I don't know how to encode!
Barring eliminating unicode for data entry (these URLs are generated from Username's, where in some locales they allow unicode characters in the name), how do I make this work?
Thanks.
I thought the solution may be % encoding the URL. That's even worse. The encode became: http%3A%2F%2Fservername%2Fmedia%2FAlt.T%C3%89st%2Fdefault.wav
The solution should be to URL-encode path components, rather than the whole URL. You want to end up with:
http://servername/media/Alt.T%C3%89st/default.wav
Although, I would have expected the fail case to get a 404 and just not play anything—garbled audio is a weird result. There might be a different issue as well?

Why does the YouTube Playlist Player start at the second video?

Using YouTube Object Player (is being embedded on WordPress so can't use iFrame). Once embedded, when you press play it starts from the second video in the playlist: the first video is skipped over. No idea why. The code was generated with YouTube's own tool here https://developers.google.com/youtube/youtube_player_demo and I've pasted the code below. Any suggestions on how to fix it?
<object width="640" height="360">
<param name="movie" value="https://www.youtube.com/v/videoseries?listType=playlist&list=PL1C53ED506CD9B801&modestbranding=1&rel=0&theme=light&version=3"> </param>
<param name="allowFullScreen" value="true"></param>
<param name="allowScriptAccess" value="always"></param>
<embed src="https://www.youtube.com/v/videoseries?listType=playlist&list=PL1C53ED506CD9B801&modestbranding=1&rel=0&theme=light&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed>
</object>
The solution is just simple..
go to https://developers.google.com/youtube/youtube_player_demo
Load the player with your playlist and to enable playlist to start from first video, you just need to put '0' in Go to (enter playlist index no.) column and hit the 'Go' button.
Works for me!
Thanks!
You need to insert the following code.... &index=-1
And one more approach i got, even this one is so easy.
To embed playlist, try using:
https://www.youtube.com/embed/?listType=playlist&list=
instead of
http://www.youtube.com/embed/videoseries?list=
By doing this, your playlist will play from first video onwards.
Thanks!

Implementing Soundcloud Player with Rails SDK

I´m a newbie rails developer, I´m trying to do a simple thing with rails and soundcloud but seems that after some days messing around with the API documentation can´t find the best way to do what I want.
Im trying to develop a contest for a local pub where DJ´s can send us their best track and they are voted to win a prize.
My approximation to this is storing the soundcloud url of his track in a database field and then this tracks are showed in the web through the little soundcloud player.
I think I can use this code in the view file.
<div id="player">
<object height="70" width="100%">
<param name="movie" value="https://player.soundcloud.com/player.swf? url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F{"<%= #trackid %>"}&player_type=tiny{widgetParams}"> </param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="transparent"></param>
<embed wmode="transparent" allowscriptaccess="always" height="18" width="100%" src="https://player.soundcloud.com/player.swf? url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F{trackId}&player_type=tiny{widgetParams}"> </embed>
</object>
</div>
To change the {trackid} im using the value of the track.id, which i get in the controller with this code
client = Soundcloud.new(:client_id => '2074955755d1c3997e10463d8a56960f')
# call the resolve endpoint with a track url
track = client.get('/resolve', :url => "http://soundcloud.com/forss/flickermood")
# print the track id
#trackid = track.id
This is not working.
Another way I tried to make this work is trough the oEmbed. I tried to run the example in the API documentation.
In the View file I understand I have to put the Javascript Widget:
<script src="http://connect.soundcloud.com/sdk.js"></script>
<script>
SC.initialize({
client_id: 'xxxxxxxxxxxxxxxxxxxxxxx'
});
var track_url = 'http://soundcloud.com/forss/flickermood';
SC.oEmbed(track_url, { auto_play: true }, function(oEmbed) {
console.log('oEmbed response: ' + oEmbed);
});
</script>
And in the controller this code:
# create a client object with your app credentials
client = Soundcloud.new(:client_id => 'xxxxxxxxxxxxxxxxxxxx')
# get a tracks oembed data
track_url = 'http://soundcloud.com/forss/flickermood'
embed_info = client.get('/oembed', :url => track_url)
# print the html for the player widget
puts embed_info['html']
I´m a bit lost and I think im failing in some basic thing, and thats why I dont find info about how exactly implement this.
Thanks for your time
This line in your view jumps out at me:
<param name="movie" value="https://player.soundcloud.com/player.swf? url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F{"<%= #trackid %>"}&player_type=tiny{widgetParams}"> </param>
The double quotes around your #trackid are cutting off the value parameter and messing up your HTML. Try this then check the HTML your view generates:
<param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F<%= #trackid %>&player_type=tiny{widgetParams}"></param>

Soundcloud player appears over colorbox in chrome

I'm using colorbox to display images for a website. In Chrome version 11.0.696.65 only when the color box is activated, the soundcloud player appears infront of the displayed image.
I've tried changing the z-index of the colorbox, but with no success. I'm pretty sure this is a new problem with chrome/soundcloud as I wasn't having the problem before.
UPDATE The following code works and might help someone.
#Add transparent mode to youtube
embeded_link.gsub!(/("http:\/\/www\.youtube\.com\/embed\/.{11})(")/,'\1?wmode=transparent\2')
#Add transparent mode to soundcloud
embeded_link.gsub!(/(<object height=".+" width=".+">\s*)(<param name="movie" value="http:\/\/player\.soundcloud\.com\/player\.swf)/,'\1<param name="wmode" value="transparent"></param>\2')
You need to embed your Flash with wmode="transparent" (or opaque).
Here's a snippet with wmode inserted in both the required places.
<object height="81" width="100%">
<param name="wmode" value="transparent"></param>
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F5475496"></param>
<param name="allowscriptaccess" value="always"></param>
<embed wmode="transparent" allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F5475496" type="application/x-shockwave-flash" width="100%"></embed> </object>
See: http://kb2.adobe.com/cps/127/tn_12701.html

Safari WIndows and Transparent Flash

// Edit: The issue now appears to be confined to Safari for Windows.
Around the time Safari for Windows 4 came out I started hearing from users that wmode=transparent was no longer working in Safari.
I have googled this many times but have not come up with any answers. I have tried reducing interference by using tags as opposed to scripts to embed the Flash but with no success.
An example is here: http://hiv411.org/safari.php alternately embedded with script at http://hiv411.org/
All videos use wmode=transparent and are embedded via tags. All work fine in every browser I have except Safari.
Code looks like so on safari.php
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" name="test" width="289" height="263" align="middle" id="test">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swfs/BBattLeft.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />
</object>
Much obliged for any help!
UPDATE: The problem is with the flash player for windows safari but has been solved after Flash Player version 10.0.45.2
Yes, It is only with Safari on Windows!
And it's interesting that there is not much written about this on the internet I've been experiencing the same issue, I guessed at first that it has a default value of #FFFFFF for bgcolor and I tried setting it to transparent (not wmode but bgcolor!). it still works in every other browser but it had a green color in Safari (so don't try that! and no the bug is not with the word transparent not being defined! I tried!).
Seems that we have to wait for apple to fix it in the next versions but if you want to change the background color if you only have a solid color underneath you can use:
if you're using the adobe script or javascript to display the flash (recommended)
<!--html-->
<script src="[adobe flash detector script]">
AC_FL_RunContent( 'wmode', 'transparent','bgcolor', 'xxxxxx');
</script>
>
else if youre using embed and or for the <noscript>:
<param name="wmode" bgcolor="#xxxxxx" value="transparent">
...aslo
<embed wmode="transparent" bgcolor="#xxxxxx">
if you wanna detect safari on windows and not display it - or maybe give the the least zindex:
//Javascript:
var isSafari = (navigator.userAgent.indexOf("Safari") != -1) ? true : false;
var isWindows = (navigator.userAgent.indexOf("Windows") != -1) ? true : false;
if (isSafari && isWindows) document.getElementById('yourflashid').style.display = 'none';
if (isSafari && isWindows) document.getElementById('yourflashid').style.Zindex = '-1000';
>
if you have php it's better to do it with php as changing DOM elements with js makes page load slower and requires javascript
<?php
//PHP
/* i like to make a .php external css style sheet
(you have to have a transitional HTML document!
or most browsers will not read it beacuse of difference in MIME types!)*/
function agent($browser) {
$useragent = $_SERVER['HTTP_USER_AGENT'];
return strstr($useragent,$browser);
}
if(agent("Safari") != FALSE) {
if(agent("Windows") != FALSE) { // on windows
?>
#myflash {display:none;}
#verisignflash {z-index:-100; /* for example I already made #000 bgcolor for this and looks right*/
&lt?php
} //All Safari's
}
... and then the code for Safari in general as the rest seem to be compatible! however you can add and else statement here and seperat them
If someone finds a better option I will be glad to read it here!
I have the same problem with Safari for Windows.
But after I've updated my Flash Player to version 10.0.45.2,
the problem is gone.
So I think it's a Flash player bug.

Resources