Enable responsive video player from Youku.com

Posted in: Newspaper
Post count: 1

Hi,

I am trying to add a script from youku.com partner’s program which enables me to share videos in my post. The script works well in PC, however I noted I am not able to work out a auto reponsive video player in the mobile devices. Could someone help me how to make it? Here is the script example:

<div id=”youkuplayer” style=”width:480px;height:400px”></div>
<script type=”text/javascript” src=”//player.youku.com/jsapi”></script>
<script type=”text/javascript”>
var player = new YKU.Player(‘youkuplayer’,{
styleid: ‘0’,
client_id: ‘client ID’,
vid: ‘Video ID’,
newPlayer: true
});
</script>

When I change the width from 480px to 100% it works well. But if I use 100% as the height in the same time, the player will be resized to a very small box. A friend told me to change the CSS to detect the PC/Mobile and set the corresponding sizes. But I have no idea how to do it? Appreciate if anyone can help me on this. Thank you so much in advance.

Post count: 20688

Hi,

You could set fixed height for each device, by creating custom code and entering it in the Theme panel->Custom code->Advanced CSS
https://www.screencast.com/t/N6eTfj80sW
So you will have different heights based on device.
Using the default embedding of a video in the post, there is no such problem. Maybe you should contact the script providers, they might have a solution for you.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.