Unable to play JWPlayers on my HTML page anymore

UPDATE: ISSUE RESOLVED. The FitVids code was causing the JWPlayer to not display properly. Appreciate all the assistance!

I've been looking at my code for too long and still can't pinpoint the problem after making a few tweaks. Can one of you smart individuals take a look and point out where I went wrong?

The page is supposed to contain three embedded JWPlayers with random videos. It should use the CSS file designed for desktop screens, but there's also one for iPhones included.

The code snippet below showcases the integration of one of the three players.

HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title>New Site</title>
    <script type="text/javascript" src="http://www.billarga.com/newsite/player/jwplayer.js"></script>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <link rel="stylesheet" media="all and (max-device-width: 480px)" href="http://www.billarga.com/newsite/css/iphone.css">
    <link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" href="http://www.billarga.com/newsite/css/ipad-portrait.css">
    <link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" href="http://www.billarga.com/newsite/css/ipad-landscape.css">
    <link rel="stylesheet" media="all and (min-device-width: 1025px)" href="http://www.billarga.com/newsite/css/ipad-landscape.css">
    <link rel="stylesheet" media="all and (min-width: 1824px)" href="http://www.billarga.com/newsite/css/screen.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script src="http://www.billarga.com/newsite/js/jquery.fitvids.js"></script>
    <script>
      $(document).ready(function(){
        $("#page-wrapper").fitVids();
      });
    </script>
</head>

<body>
    <div id="page-wrapper">
        <div id="video-wrapper">
            <div id="video">Video 1</div>
                <script type="text/javascript">
                    jwplayer('video').setup({
                    'flashplayer': 'http://www.billarga.com/newsite/player/player.swf',
                    'file': 'http://www.billarga.com/newsite/content/0000001/1.mp4',
                    'controlbar': 'bottom',
                    'width': '480',
                    'height': '360'
                    });
                </script>
        </div>
    </div>
</body>
</html>

CSS

  body {
    margin: 0;
    padding: 0;
    color: #000000;
    font-size: medium;
    }
    a           { color: blue; text-decoration: none; }
    a:visited       { color: blue; text-decoration: none; }
    a:hover             { color: blue; text-decoration: underline; }
    h1          { font-size: x-large; text-align: center; }
    #page-wrapper {
    margin: 0 auto;
    width: 100%;
    height: 100%;
    }
    #video-wrapper {
    width: 100%;
    height: 360px;
    }
    #video {
    float: left;
    }

Answer №1

To optimize your jwplayer placement, consider encapsulating it within jQuery's document ready callback as shown below:

<script>

$(document).ready(function(){
    $("#page-wrapper").fitVids();

    jwplayer('video').setup({
        'flashplayer': 'http://www.billarga.com/newsite/player/player.swf',
        'file': 'http://www.billarga.com/newsite/content/0000001/1.mp4',
        'controlbar': 'bottom',
        'width': '480',
        'height': '360'
    });
});

</script>

Answer №2

Have you transferred the second and third players from the initial one by copying and pasting? If that’s the case, you might end up with duplicate players on the page until you update their names like video_1, video_2, video_3.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using AJAX to dynamically edit and update PHP data

The information displayed on my index.php page is fetched from a database using the mysqli_fetch_array function. The data is presented in a table format with fields like Name, Age, Email, and Update. An edit button allows users to modify the data. Here is ...

Ensuring the validity of email addresses by blocking visitors from proceeding if their email is deemed invalid

We currently operate a Shopify store and have implemented a script that validates email addresses. If the email address input is not valid, an alert is triggered prompting the user to correct it before proceeding to the next stage. Additionally, another sc ...

Tips on how to decorate a radio button using borders and colors

How can I change the color of my radio button and its border color? I attempted to modify the code below, but it is not producing the desired result. li.payment_method_bacs input[type='radio']:checked:before { background: black !important ...

Bootstrap modals are refusing to open

I have encountered an issue where the images are not displaying on my modal. I have tried changing both the images and the code itself, but being new to this, I am unsure of what exactly is causing the problem. Could it be a fault in the Javascript code or ...

Implementing Event Listeners for buttons generated dynamically

Currently immersed in an exciting side project and encountered a small hiccup. Essentially, I have a page where users can log in to Spotify. Upon login, they are redirected to a page showcasing their top 10 artists in individual cards, complete with the ar ...

Check the input in the text box against the selected options to validate it

Currently, I am working on an add contacts page where I am facing the challenge of displaying an error message or highlighting input as invalid if a user tries to enter a contact name that already exists. It seems like one solution could be populating a s ...

Flashes hidden DIV in a split second using JavaScript cookies

I have set up a pop-up lightbox on my webpage along with a cookie using JavaScript to display the lightbox every 15 days. The code functions as intended, but if I continue refreshing the page to check the cookie status, the lightbox briefly flashes on the ...

Fancybox is experiencing some technical difficulties

Can anyone help me troubleshoot why my fancybox code isn't working properly after adding the script below to the body? Any thoughts on what might be causing this issue? $(document).ready(function() { $("a#example4").fancybox({ 'opa ...

Unleash the Power of Your Webpage: Instantly Engage Full

Is there a way to automatically make a webpage open in full screen mode as soon as it is loaded? Here's what I currently have: var elem = document.documentElement; function openFullscreen() { if (elem.requestFullscreen) { elem.requestFull ...

Execute the button click function repeatedly at specific time intervals using Javascript

I have a submit button on my page that uses the POST method to send a value. <button id="log" class="btn bg-purple" formmethod=post value="2" name="start" formaction=start_server.php>Get Log</button> Clicking this button retrieves a log file ...

Information provided in a login form does not carry over to a different page display

I'm currently facing a problem with my JavaScript code. I have constructed a login form and am attempting to transfer the data from the form to another page where it will be showcased in a table. Regrettably, the details are failing to appear on the s ...

How can I add rows to the tbody of a table that is already inside a div container?

I have an existing table and I want to append a tbody element to it. Below is an example of the HTML table: <div id="myDiv"> <table class="myTable"> <thead> <tr> <th>ID</th> ...

HTML Changing the background color of the body using HTML elements

I need assistance with an exercise that requires changing the color of a letter and background when clicking on text. I have successfully changed the text color but am struggling to change the background color. Can someone provide guidance? <html> ...

Use JavaScript to generate an HTML element that has an attribute mirroring its text content

Trying to figure out how to create an HTML element similar to this: <option value="Replaced">by this</option> For example: <option value="ThisIsTest">ThisIsTest</option> UPDATE Using jQuery, I need to achieve something like thi ...

Tips for preventing route changes when clicking on a hash tag in AngularJS

I have a link in a small carousel on the page, and I am utilizing AngularJS routing to create a Single Page App. The tiny carousel uses anchor tags as buttons to navigate between images. <div class="carousel-controls-mini"> <a href=" ...

Reveal or conceal the footer section as you reach the end of the webpage

My webpage layout consists of a fixed nav-bar at the top, a drop down sidebar, a <div> element with an id of content, some content inside the <div>, and a bottom <div> with a fixed position. I am trying to hide the bottom <div> whe ...

Why does one of the two similar javascript functions work while the other one fails to execute?

As a new Javascript learner, I am struggling to make some basic code work. I managed to successfully test a snippet that changes text color from blue to red to ensure that Javascript is functioning on the page. However, my second code attempt aims to togg ...

What is the best way to define a margin according to the size of the device being used

I am working on an angular/bootstrap web app and need to set a left margin of 40px on md, xl, lg devices and 0px on sm device. I attempted to create a spacer in styles.scss like this: $spacer: 1rem; .ml-6{ margin-left:($spacer*2.5); } Then in my HTML, ...

When a link is right-clicked, the window.opener property becomes null

Currently, I am utilizing the window.opener property in JavaScript to update the parent window from a child window. The parent window simply consists of a table with data and a link to open the child window. When the child window is launched, a JavaScript ...

Relocate a table beside an image

Check out the layout of my webpage: ------------- ------------- Image here ------------- ------------- Table1 here Table2 here Table3 here My goal is to redesign it to look like this: ------------- ------------- Image here Table1 here - ...