Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9255253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:40:31+00:00 2026-06-18T11:40:31+00:00

I am using a JW video player and the way it is implemented for

  • 0

I am using a JW video player and the way it is implemented for a single video is as below

<div id="myElement">Loading the player...</div>

<script type="text/javascript">


jwplayer("myElement").setup({
    file: "<?php echo $dbVideoFile; ?>"
});

</script>

</div>

No what I want to do is that I want to do is loop through each existing video and to display a jw video player for each video. Only problem is that it is not quite working, it is only display the jsplayer for one video, the other videos do not show anything but blank. What am I doing wrong below:

    <p>
<?php foreach ($arrVideoFile[$key] as $v) { ?>
<div id="myElement">Loading the player...

<script type="text/javascript">


jwplayer("myElement").setup({
    file: "<?php echo 'VideoFiles/'.$v; ?>"
});

</script>

</div>
<?php } ?>
</p>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:40:32+00:00Added an answer on June 18, 2026 at 11:40 am

    id tag should be unic so JWPlayer is confused when calling #myElement

    Try incrementing a value and dynamically rename “myElement-” + i

    I didn’t get to test but that shoudl work:

      <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>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using a single video player, I can successfully pass in additionalAdTargetingParams with values
I am using Ooyala video player in my project, I need a way to
Is there any way to play .wmv files using html5 video player?
I am using the xhtml valid way to embed below: <object type=application/x-shockwave-flash width=640 height=360
I am using an html5 video player on a website. When the user starts
I created a flash video player using Flash CS3. I exported the player to
I'm building a video player using Flash CS4 (hereby referred to as Flash) to
I'm using VideoJS to as my video player for a project I've been working
I'm currently developing a video player for streamed-content using the AVPlayer Framework. I stumbled
Does anyone have a working example of a video player built using Qt phonon?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.