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

  • Home
  • SEARCH
  • 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 9274993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:29:02+00:00 2026-06-18T16:29:02+00:00

Our app is generating this markup: <video id=’player’ width=’512′ preload=’none’ controls=’controls’> <source src=’http://unpredictablesite.com/notfound.mp4′ type=’video/mp4′

  • 0

Our app is generating this markup:

<video id='player' width='512' preload='none' controls='controls'>
  <source src='http://unpredictablesite.com/notfound.mp4' type='video/mp4' />
  <source src='http://predictablesite.com/exists.mp4' type='video/mp4' />
</video>

We are using MediaElement.js (ver 2.10.0) and want the player to try playing the source from unpredicatablesite.com first, then roll over to the source from predicatablesite.com if the first one isn’t found.

Interestingly, rolling over to the next source seems to work when using the HTML5 video tag alone, but not with MediaElement.js. What options do we have to get this to work? The error: function(){} on player instantiation doesn’t seem to trigger on source 404 errors, so that plan didn’t work.

  • 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-18T16:29:04+00:00Added an answer on June 18, 2026 at 4:29 pm

    You could check for the first source’s status and if 200 (that essentially means that file exists on the server) you could assign the video souce all dynamically.
    In case the video does not exist, then assign video the second source.

        var http = jQuery.ajax({
            type:"HEAD",
            url: $('source:first').attr('src'),
            async: false
          });
    
    
      var vidsrc;
    
      if ( http.status == 200 ) vidsrc = $('source:first').attr('src');
      else $('source:eq(1)').attr('src'); 
    
    
      var myvid = new MediaElementPlayer('#player', {
         translationSelector: true,
         success: function (mediaElement) {
    
            var sources = [{ src: vidsrc, type: 'video/mp3' }];
    
            mediaElement.setSrc(sources);
            mediaElement.pause();
            mediaElement.load(); }
         });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's a third party application generating huge amounts of log entries on our app
Our app uses Facebook app API and as of this morning, our log out
Our app needs to programmically pair a bluetooth device with an android phone. This
In our app we allow the display of html from an external source, so
Our app uses a component that requires a license file in the directory with
Our app runs in jvm 32 bit, even when in windows x64. Now, at
Our app servers (weblogic) all use log4j to log to the same file on
Our app uses a string to house character-values used to indicate enum values. for
Our app supports different browser version from IE to Firefox to Chrome. Now, some
Our app, distributed via ClickOnce, takes 10.8 seconds on average to start up. After

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.