Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Add Youtube address to wordpress shortcode


Hello,
Is there a way to use the youtube address e.g. https://www.youtube.com/watch?v=4LTXZujdhN4 for the mediaid in the wordpress shordcode instead of adding it to the the media player from the dashboard.
The site I'm working on currently the addresses in a custom field which I would like to use instead of manually creating the media id.

I have added this to my page template <?php echo JWP6_Shortcode::the_content_filter('[jwplayer player="1" mediaid="' . $jwplayer_id . '"]'); ?>

But get the message
Error loading player:<br> No playable sources found

Any help would be great.

Cheers,
D

3 Community Answers

webmaster

User  
1 rated :

Ok, so I swapped out mediaid for file and it seems to work sometimes.

Now in the area where the player is, it will sometimes show fine, other times flash up and disappear, and others not show at all. Though when I inspect the browser source, the jwplayer elements are always there.

<div id="jwplayer-0_wrapper" style="position: relative; display: inline-block; width: 100%; height: auto;"><div class="fluid-width-video-wrapper"><object type="application/x-shockwave-flash" data="http://p.jwpcdn.com/6/8/jwplayer.flash.swf" bgcolor="#000000" id="jwplayer-0" name="jwplayer-0" tabindex="0" style="position: absolute;"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"></object></div><div id="jwplayer-0_aspect" style="display: block; margin-top: 56.25%;"></div><div id="jwplayer-0_jwpsrv" style="position: absolute; top: 0px; z-index: 10;"></div></div>

webmaster

User  
-1 rated :

Ok, seems to have been caused by other jqueries on the page. i.e. elegant themes "learn more" dropdown slider

enjoy your day,
d

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you got it.

This question has received the maximum number of answers.