Soundcloud player appears over colorbox in chrome - ruby-on-rails

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

Related

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

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:

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!

Whats the best way to embed a flash file from a link?

I have looked around, but still have not found a very good answer to my question.
I would like to know how I can embed a flash game into my website Via HTML or Java in order for it to play.
I have the SWF file, but am unable to put the file on the site, so I got this link "https://dl-web.dropbox.com/get/flight.swf?w=AAAYS8vwABuIJB3QbyhV1kSX778W0mXh4xRoQ0ADqm4w6g" that is JUST the flash game
Whats the best way to insert this into my site?
Below is a general script which will embed your flash movie in a html page, theres several ways to do this but below will work just copy and paste the code on to your html page in the body area.Check the adobe website if you need other parameters or more information.
<object id="yourmovie.swf" width="550" height="450" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" align="middle" bgcolor="#ffffff">
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="src" value="http://www.yourwebsite/yourmovie.swf" />
<param name="allowscriptaccess" value="sameDomain" />
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<embed id="slots.swf" width="476" height="321" type="application/x-shockwave-flash"src="http://www.yourwebsite/yourmovie.swf"
allowScriptAccess="sameDomain" quality="high" allowscriptaccess="sameDomain"
pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" bgcolor="#ffffff" />
</object>
To use a link from java my option will be create a button/link thats open another window with the above on that html page

Why do the buttons users could click at the end of embedded YT videos not appearing?

Only the subscribe button appears at the end (along with a display of how many likes/dislikes checked direct on YT). Is there an embed code to get these back so users can vote on my site?
Sample embed code:
<object style="height: 360px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/XXXXXXXXXXXXX?version=3&controls=1&autohide=1&modestbranding=1&rel=0&autoplay=1&showinfo=0&showsearch=0&iv_load_policy=3&border=2&color1=0xB24D7E&color2=0xfff0f5&fs=1&hd=0&feature=player_embedded" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /><param name="allownetworking" value="internal" /><embed src="http://www.youtube.com/v/XXXXXXXXXXXX?version=3&controls=1&autohide=1&modestbranding=1&rel=0&autoplay=1&showinfo=0&showsearch=0&iv_load_policy=3&border=2&color1=0xB24D7E&color2=0xfff0f5&fs=1&hd=0&feature=player_embedded" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" wmode="transparent" allownetworking="internal" width="640" height="360"></embed></object>
Embedded AS3 player
.If you open http://youtube.googleapis.com/v/_Acr-FWRWXE?autoplay=1,
it's equivalent to AS2 player,
http://youtube.googleapis.com/v/_Acr-FWRWXE?autoplay=1&version=2
However, if you only open http://youtube.googleapis.com/v/_Acr-FWRWXE without parameters(such as autoplay), http://youtube.googleapis.com/v/_Acr-FWRWXE no more version 2, it's version 3 now.
You need version 3(AS3) for display likes/dislikes icon, that's means
http://youtube.googleapis.com/v/_Acr-FWRWXE?version=1234567 or
http://youtube.googleapis.com/v/_Acr-FWRWXE?version=3
You open http://youtube.googleapis.com/v/_Acr-FWRWXE, play at the
end, you copy the embed code, unfortunately the embed code is wrong,
it give you
name="allowScriptAccess" value="always">
src="http://www.youtube.com/v/_Acr-FWRWXE&hl=en_US&feature=player_embedded&version=3"
type="application/x-shockwave-flash" allowfullscreen="true"
allowScriptAccess="always" width="640" height="360">
As you can see, no question mark ? inside
http://www.youtube.com/v/_Acr-FWRWXE&hl=en_US&feature=player_embedded&version=3
, thats means its still version 2, you shoud change to
http://www.youtube.com/v/_Acr-FWRWXE?hl=en_US&feature=player_embedded&version=3
instead.
IFrame embed.
Using www.youtube.com/embed/a6_AHH-A0ks
Hope this help :)

rails 3 embed video

I'm trying to embed youtube video.
in the videos db table, i have field called "link".This contains the link of the video.
In Controller Videos, there is just empty method def vidlist, since i'm just trying to display single video.
I have vidlist.html.erb:
<blink>
<h1>Vidlist</h1>
<object width="640" height="385">
<param name="movie" value="<%= Video.first.link %>">
</param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="<%= Video.first.link %>"
type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
</blink>
the link contains this string:http://www.youtube.com/v/KgmeL_xuB0I?fs=1&hl=en_US&rel=0&autoplay=1
In routes .rb, i have uncommented the default route matching.
Then, i started server.Entered localhost:3000/Videos/vidlist
The browser doesn't display anything at all.
and there's nothing in the console too when the server is running
Have you tried using html_safe on the link? This will help ensure that you don't have issues with escape chars etc.

Resources