1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Errors when I add additional vid player code

Discussion in 'JavaScript' started by chrisj, Mar 24, 2015.

  1. #1
    I'm trying to add another video player onto a web page.

    With this code - no errors:

    
    <head> ...
    <script type="text/javascript">
    $(document).ready(function() {
    var tn1 = $('.tn3gallery').tn3({
    width: 125,
    height: 120,
    autoplay: false,
    touch: {
    skin: "tn3t"
    },
    image:{
    crop:true,
    },
    content:[{
    plugin: "mediaelement",
    options: {
    features: ['playpause', 'progress', 'playpause']
    }
    }],
    });
    });
    
    </head>
    
    <body>...
    <div id="content">
    <div class="tn3gallery">
    <ol>
    <li>
    <div class="tn3 content">
    <video width="130" height="125" type="video/mp4" poster="../img/test.jpg" src="../video/test.mp4"></video>
    </div>
    </li>
    </ol>
    </div>
    </div>
    
    ....</body>
    
    Code (JavaScript):
    But if I add a 2nd player code, like this:

    
    <div id="content">
    <div class="tn3gallery">
    <ol>
    <li>
    <div class="tn3 content">
    <video width="130" height="125" type="video/mp4" poster="../img/test1.jpg" src="../video/test1.mp4"></video>
    </div>
    </li>
    </ol>
    </div>
    </div>
    
    Code (JavaScript):

    I get these errors:
    http://www....com/skins/tn3/skins/tn3/preload.gif Failed to load resource: the server responded with a status of 404 (Not Found)

    http://www.....com/video/test1.mp4 Failed to load resource: net::ERR_CONNECTION_RESET

    Yet, the videos play successfully.

    Can you help me with adding player code without errors?
    I look forward to your reply.
     
    chrisj, Mar 24, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Well, since I don't know the javascript code, I would start by fixing the IDs - you can't have multiple IDs with the same name on a page. (That shouldn't really turn into errors, though - at least since it seems the player reacts to classnames...). Well, it's a start.
     
    PoPSiCLe, Mar 24, 2015 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    Much less what makes it a list, why do you need a DIV if you have a LI, why do you need a DIV around the OL if it is indeed a list, etc, etc?

    The markup is such bloated pointless gibberish, good luck attaching the bloated train wreck of needlessly cryptic BS known as jQuery to it... or at least I'm assuming that mess of crap that should probably just be in the markup is jQuery.
     
    deathshadow, Apr 15, 2015 IP