Reputation: 11
We are facing a issue in JW player while making a youtube video playable on click of a transparent image which will be on top of the video. Works fine on click when we are using a video plays from a physical path.
<script type='text/javascript'>
$(document).ready(function () {
videoUrl = "<%=strHomeTOpVideo%>";
jwplayer('playerYinHVRkPdrqk').setup({
file: videoUrl,
image: "<%=strVideoBgImg%>",
width: '100%',
aspectratio: '16:7',
controls: 'true',
autostart: 'true',
repeat: 'true',
primary: 'flash',
ga: {
idstring: "title",
trackingobject: "pageTracker"
}
});
});
</script>
<script type='text/javascript'>
$(document).ready(function () {
$("#MainbgImage").click(function () {
videoUrl = "<%=strHomeTOpVideo%>";
file: videoUrl,
jwplayer('playerYinHVRkPdrqk').play(true);
});
});
</script>
Here in the first scripting tag i am passing the video URL works for PC's without any click of the background image. But for mobile devices JW player doesn't support auto play so in the second script i have given a click functionality which indeed play the same video configured in the first script tag. Now i need the same kind of functionality works also for youtube video which we are unable to make it play on click. For reference here is our staging url using youtube video in the main page.
http://demo3.devtpit.com/
JW Player Version : 6.10.4906
Upvotes: 1
Views: 308
Reputation: 885
Autostart doesn't work on mobile devices at all.
From JW Player documentation:
Note that autostarting does not work on mobile phones (Android, iOS), since a fullscreen video takeover would be a jarring experience. Video also swiftly depletes 3G/4G bandwidth allowances.
http://support.jwplayer.com/customer/portal/articles/1428525-autostarting-on-page-load
Upvotes: 1