Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Youtube gallery and internet explorer issue


Go to End


7 Posts   2522 Views

Avatar
TomG from Squashed Pixel

Community Member, 6 Posts

24 August 2010 at 10:43pm

Hi Everyone, I spent a while trying to get my head around this so thought i'd post the problem here on the off chance anyone else needs it.

I had installed the youtube gallery module and customised it all as needed including opening the video in a pop up overlay instead of a new window. This worked perfectly in all browsers apart from any version of internet explorer. IE for some reason instead of playing the youtube video, tries to download it.

I've still no idea why it happens but I managed to come up with this work around. It essentially forces lightwindow to show an inline div containing the normal object embed code instead of showing the video playing in an external iframe

all this is done in the YouTubeGallery.ss file

<% control YoutubeVideos %>

<li>
<div class="still">
<% if Top.ShowVideoInPopup %>
<a
params="lightwindow_width={$PlayerWidth},lightwindow_height={$PlayerHeight},lightwindow_loading_animation=false,lightwindow_type=inline, lightwindow_iframe_embed=true"
href="#$Pos"
class="lightwindow"
>
<% control SmallThumbnail %>
<img src="$URL" alt="$Title" width="$Width" height="$Height" />
<% end_control %>
</a>
<% else %>
<a href="$PlayerURL&rel=0" title="$title">
<% control SmallThumbnail %>
<img src="$URL" alt="$Title" width="$Width" height="$Height" />
<% end_control %>
</a>
<% end_if %>
</div>
<div class="info">
<h1>
<% if Top.ShowVideoInPopup %>
<a
params="lightwindow_width={$PlayerWidth},lightwindow_height={$PlayerHeight},lightwindow_loading_animation=false,lightwindow_type=inline, lightwindow_iframe_embed=true"
href="#$Pos"
class="lightwindow"
> $Title </a>
<% else %>
<a href="$PlayerURL&rel=0" title="$Title">$Title</a>
<% end_if %>
</h1>
<p> $Description
<p><strong>Duration : </strong>$Runtime</p>
</p>
</div>
<div class="clear"></div>
</li>
<div id="$Pos" style="display:none;">
<object width="640" height="385">
<param name="movie" value="$PlayerURL&rel=0">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="$PlayerURL&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" width="640" height="385"></embed>
</object>
</div>
<% end_control %>

Hope that all makes sense to every one.

Avatar
davidm2010

Community Member, 107 Posts

24 August 2010 at 11:42pm

I would like to know how you were able to get it to work in 2.4. I tried it and could not get the video to pop up.

Avatar
TomG from Squashed Pixel

Community Member, 6 Posts

25 August 2010 at 12:47am

Edited: 25/08/2010 12:50am

Have you got the 'Show videos in a popup (rather than external link)' checked in the back end? The light box was always showing up for me when I had this checked, the only issues I was having was getting the actual video to play in internet explorer

Also make sure you have these sections added on to the params tag on the link:

lightwindow_type=inline, lightwindow_iframe_embed=true

otherwise the light window just shows up as a blank window

Avatar
Pranil

Community Member, 17 Posts

23 September 2010 at 10:40am

Hey Tom

Cheers for the post, worked a treat for me. I've attached it as a file (with a few minor edits), so ya don't have to worry about formatting the code. I did find another bug though (although I've only tested in IE6 & 7, Windows XP in Parallels at this stage). When viewing the video in a popup, if you close it with the video still playing, the video closes but the audio keeps playing in the background. Really quite strange. Will update once I've tested on some actual windows machines *shudder*.

Avatar
TomG from Squashed Pixel

Community Member, 6 Posts

23 September 2010 at 8:02pm

Thanks for that Pranil, I've not come across the audio problem before but I'll certainly have another look to make sure it's not something I've just missed. Thanks for attaching the file as well, I should probably have done t hat in the first instance, makes it much easier :)

Avatar
LisaB

Community Member, 28 Posts

8 October 2010 at 11:17pm

Hi everyone, first off thanks for your work on this Tom -I was getting the IE wanting to download the video problem when using the popup, and your template has solved it. I wonder if you could help me with a problem though.

I want my youtube gallery to work on mobiles as well as pcs. On pcs, the display videos in a popup option works great with your template, but my android phone tells me there's an error on the page and stops rendering it. Using the old template the page renders on mobiles, the popup displays but it is empty. If I switch to the non popup option, the mobile uses its native youtube player which works great, but on a pc you get taken to the youtube site, which I don't want.

Would you have any ideas on how to combine the two so that pcs use the popup and mobiles use their own youtube apps? I have looked into browser detection but I'm not sure what I'm best off checking for - flash/javascript/user agent and I wondered if someone more knowledgeable than me could think of a relatively easy way to achieve what I'm trying to do!

PS has anyone got their YouTube gallery to sort videos any other way than oldest first? It doesn't matter what sortby option I choose, they still come out this way - from what I've read it looks like this may be a problem with youtube itself?

Thanks in advance for any help or advice.

Lisa

Avatar
jseth

Community Member, 98 Posts

10 February 2011 at 7:40am

Edited: 10/02/2011 7:40am

Hi Pranil,
I saw in one of your posts "When viewing the video in a popup, if you close it with the video still playing, the video closes but the audio keeps playing in the background. Really quite strange." I've set up my YouTube gallery and it works quite wonderfully with the pop up window, however, it actually does keep running the audio after you close it before you actually stop the video (in IE only). Have any of you really smart folks figured out how to really make it stop?