• 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?

Kevin

Well-known member
#3
I can see it but it doesn't play automatically. iPhone doesn't support auto play.
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)
 

Allen

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

Landscape: As above.

HTH...
Allen

Oops, I see Chris beat me to the punch. :)
 

Kevin

Well-known member
#5
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.
 

Martok

Well-known member
#6
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

Well-known member
#7
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?
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.
 

Kevin

Well-known member
#9
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?
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.
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...

https://www.youtube.com/html5

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

Brogan

XenForo moderator
Staff member
#10
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.

Code:
<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>
    </div>
</xen:if>
 

Martok

Well-known member
#12
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...

https://www.youtube.com/html5

... 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?
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. :)
 

Kevin

Well-known member
#13
I wondered what you were up to.
How have you implemented it?
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 =
Code:
<xen:include template="ad_member_view_below_avatar" />
Replacement =
Code:
<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>
</xen:if>
Then in my extra.css....
Code:
#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.
 

Brogan

XenForo moderator
Staff member
#14
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.
 

Kevin

Well-known member
#15
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.
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
 

Kevin

Well-known member
#16
Hopefully Brogan's code will help give HTML5 without having to do this. :)
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.
 

Martok

Well-known member
#18
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.
Interesting. How does it work with BBCode Media sites then? All of the YouTube videos are always displayed in HTML5 with that.