问题
What is happening is lets say I have 2 questions which I access through a loop and question 1 has two videos and question 2 has a video, it displays the 2 videos for question 1 but for question 2 it does not display a video, it just displays Loading video player ...
. How can I get the video to be displayed for question 2 as well as question one?
Below is code:
<?php
foreach ($arrQuestionId as $key=>$question) {
//start:procedure video
$vid_result = '';
if(empty($arrVideoFile[$key])){
$vid_result = ' ';
}else{
?>
<p>
<?php
$i = 0;
foreach ($arrVideoFile[$key] as $v) { ?>
<div id="myElement-<?php echo $i; ?>">Loading the player...
<script type="text/javascript">
jwplayer("myElement-<?php echo $i; ?>").setup({
file: "<?php echo 'VideoFiles/'.$v; ?>"
});
<?php $i++; ?>
</script>
</div>
<?php } ?>
</p>
<?php
}
}
?>
来源:https://stackoverflow.com/questions/14764584/it-is-not-displaying-video-players-for-all-existing-videos