Jump to:

10977 Posts in 2720 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Youtube gallery and internet explorer issue

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1516 Views
  • TomG from Squashed Pixel
    Avatar
    Community Member
    6 Posts

    Youtube gallery and internet explorer issue Link to this post

    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.

  • davidm2010
    Avatar
    Community Member
    107 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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.

  • TomG from Squashed Pixel
    Avatar
    Community Member
    6 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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

  • Pranil
    Avatar
    Community Member
    17 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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*.

    Attached Files
  • TomG from Squashed Pixel
    Avatar
    Community Member
    6 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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

  • LisaB
    Avatar
    Community Member
    28 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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

  • jseth
    Avatar
    Community Member
    98 Posts

    Re: Youtube gallery and internet explorer issue Link to this post

    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?

    1516 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.