I am working on JW Player and want to add playlist dynamically with wordpress metabox. I am facing the issue to use php in between javascript
I am using JW Player and playlist code you can find here..http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16006/javascript-playlist-in-the-jw-embedder
I am not getting any output if I use php between ‘playlist’:[ …here… ] – in fact I want to use php to make it loopable so user can add multiple video to make playlist
<script type="text/javascript">
jwplayer("mediaplayer").setup({
'flashplayer': '<?php bloginfo( 'stylesheet_directory' ); ?>/jw/player.swf',
'id': 'playerID',
'width': 640,
'height': 540,
//'skin': '<?php bloginfo( 'stylesheet_directory' ); ?>/jw/skins/bekle/bekle.zip',
<?php if ($custom_metabox->get_the_value('video_playlist') ) { ?>
//playlist starts
'playlist.position': '<?php echo $custom_metabox->get_the_value('plposition') ?>',
'playlist.size': '180',
'playlist': [
<?php while($custom_metabox->have_fields('playlistvideos'))
{ ?>
{
'file': '<?php echo $custom_metabox->the_value('videourl'); ?>',
'title': '<?php echo $custom_metabox->the_value('videotitle'); ?>',
'image': '<?php echo $custom_metabox->the_value('videoimage'); ?>',
'duration': '<?php echo $custom_metabox->the_value('videoduration'); ?>',
'description': '<?php echo $custom_metabox->the_value('videodescription'); ?>'
},
<?php } ?>
],
<?php } ?>
'file': '<?php echo $custom_metabox->the_value('selfhosted'); ?>',
'image':'<?php echo $custom_metabox->the_value('selfhost_image'); ?>',
});
</script>
Can anyone please guide me.. here I want to use this to make clone
Escape the single quotes or replace by double quotes