1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can somebody with an iPhone check a page for me?

Discussion in 'Off Topic' started by Kevin, Jan 27, 2014.

  1. Kevin

    Kevin Well-Known Member

    Would anybody with an iPhone mind viewing the URL below and letting me know if you see a YouTube video playing below my avatar in the sidebar? If possible, please check both portrait & landscape modes.


    Thanks :)
  2. Chris D

    Chris D XenForo Developer Staff Member

    I can see it but it doesn't play automatically. iPhone doesn't support auto play.
    Kevin likes this.
  3. Kevin

    Kevin Well-Known Member

    Thanks for checking and letting me know about the auto-play! :cool: I'm going to assume the Android browser also doesn't support auto-play because, after tweaking the embed code a bit, I can see the video on my phone but it doesn't auto-play either.

    Thanks (y)
  4. Allen

    Allen Active Member

    Portrait mode: There is no side bar, but I do see a YouTube video below your avatar--not playing though.

    Landscape: As above.


    Oops, I see Chris beat me to the punch. :)
    Kevin likes this.
  5. Kevin

    Kevin Well-Known Member

    Thanks for checking, Allen.:coffee:

    My original YouTube HTML was using the old Google API link method and on my Android phone I realized nothing was showing at all, but it worked fine on my desktop, so then I was starting to wonder about iOS devices. I changed the HTML to use the embed link like the XF Media Site definition and that worked then on my Android but without auto-play. Apparently mobile devices either don't like auto-play or Google purposely disabled it on them.
  6. Martok

    Martok Well-Known Member

    Checked on Android, same results as you got.

    BTW is there any reason that you've embedded the Flash version of the video (when viewing on a PC) rather than the HTML5 version?
    Kevin likes this.
  7. Kevin

    Kevin Well-Known Member

    I'm just using the iframe embed link, http://www.youtube.com/embed/{id}, so it isn't something I'm explicitly setting. Now you've got me curious.
  8. AdamD

    AdamD Well-Known Member

    Iphone 5 - Youtube vid shows ok, no auto play as mentioned by others.
    2014-01-27 17.06.42.png 2014-01-27 17.07.01.png
  9. Kevin

    Kevin Well-Known Member

    OK, checking the online docs at https://developers.google.com/youtube/player_parameters#Manual_IFrame_Embeds it appears that it is not in our control as to which player is loaded, the Flash player or the HTML5 player.

    But I think I have an answer. Are you logged into Google and/or YouTube by any chance? If so, go this page...


    ... and request the HTML5 as your default player. The AWBM page was using the Flash player for me but after I just switched my default preference on that YouTube page the AWBM page is now using the HTML5 player. Woohoo?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    I wondered what you were up to.
    How have you implemented it?

    I've had YT in the profile page for a while now using a custom user field and the ad_member_view_below_avatar template.

    <xen:hook name="ad_member_view_below_avatar" />
    <xen:if is="{$user.customFields.profile_youtube}">
        <div style="margin-top: 4px; margin-bottom: -5px;">
            <iframe width="246" height="172" src="http://www.youtube.com/embed/{$user.customFields.profile_youtube}?wmode=opaque" frameborder="0" allowfullscreen></iframe>
    Kevin likes this.
  11. Kevin

    Kevin Well-Known Member

  12. Martok

    Martok Well-Known Member

    Yes I was logged into Google and now after clicking the link I get it in HTML5.

    Hopefully Brogan's code will help give HTML5 without having to do this. :)
  13. Kevin

    Kevin Well-Known Member

    Same as you, a custom user profile field (which partially prompted my other thread about not being able to associate custom user fields with add-ons), but instead of modifying the template directly (which is what the very first revision was doing) or using a template hook (which is what I switched to to avoid the template change) I'm using a Template Modification now with some tweaks. :D

    Template Modification
    Template Name = member_view
    Search Type = Simple Replacement
    Find =
    <xen:include template="ad_member_view_below_avatar" />
    Replacement =
    <xen:include template="ad_member_view_below_avatar" />
    <xen:if is="{$user.customFields.YouTube}">
    <div id="profileYouTube"><iframe name="frameProfileYouTube" src="http://www.youtube.com/embed/{$user.customFields.YouTube}?wmode=opaque&autoplay=1&origin=http://awalkerbit.me&rel=0&modestbranding=1" frameborder="0" width="100%" height="100%" seamless allowfullscreen></iframe></div>
    Then in my extra.css....
    #profileYouTube {
        width: 100% !important;
        height: 156px !important;
    I'm still messing around a bit with the CSS & HTML but I like the way it is now because, as you can see in the screenshot by AdamD, when the sidebar is set to use 100% width then the video is also 100% width instead of being a hard-coded X-by-Y size. With that set I have, for now, given up on trying to suppress entirely on the narrow width.
  14. Brogan

    Brogan XenForo Moderator Staff Member

    Honestly I wouldn't bother with a template modification for an ad_ template, unless you have multiple styles which aren't all children of a single parent.
  15. Kevin

    Kevin Well-Known Member

    In my case I try to make any & all of my changes as generic as possible & associated to an add-on because then I can quickly reuse it on multiple forums instead of redoing the work. Plus, with upgrades in mind, my two main sites are running essentially edit-free templates outside of extra.css & add-on templates so, for example, when 1.3 is released I'll be up & running with it in a matter of minutes. :D
  16. Kevin

    Kevin Well-Known Member

    I don't think it will because it was the same iframe embed link I was already using. Apparently if you don't specify your preference with YouTube then they decide which player to serve per request.
  17. Brogan

    Brogan XenForo Moderator Staff Member

    Ah, you've packaged it as an add-on.
    In that case then yes, a TM makes perfect sense.
  18. Martok

    Martok Well-Known Member

    Interesting. How does it work with BBCode Media sites then? All of the YouTube videos are always displayed in HTML5 with that.
  19. Kevin

    Kevin Well-Known Member

    I don't have an answer for that as they are both using the same iframe embed link.

Share This Page