<?php
global $rockon_data;
if(isset($rockon_data) && $rockon_data['rockon_audiotrackswitch'] == '1'){
?>
<div class="rockon_player">
	<audio id="mejs" controls autoplay>
	<?php
	global $post;
	$track_query = new WP_Query( array( 'post_type' => 'rockon_track', 'posts_per_page' => '5') );
	 if($track_query->have_posts()): 
		while($track_query->have_posts()) : $track_query->the_post();
			$audio = get_post_meta( $post->ID, 'rockon_audio_src', true );
			echo '<source src="'.esc_url($audio).'" title="'.__(get_the_title($post->ID),'rockon').'" type="audio/mpeg">';
		 endwhile; 
	 endif;
	?>	
    </audio>
</div>
<?php 
}
?>