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 8751071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:58:38+00:00 2026-06-13T12:58:38+00:00

In my web page, i have the video, it has different 3 source in

  • 0

In my web page, i have the video, it has different 3 source in it. i need to change the video src, on load the page. for that i am using this function, but i can’t get update in ipad, but firefox works fine.

jquery:

$('#task2ResultVideo source').each(function (n,s) {
       $('#task2ResultVideo').get(0).pause();
       $(this).attr('src',$(this).attr('src').replace('Task_2.4a_Host_treated', task2RslVideo));
       $(this).parents('video').get(0).load();
    } )

HTML:

<video id="task2ResultVideo" autobuffer poster="img/task2-results-host-poster.jpg">
                        <source src="Video/webm/Task_2.4a_Host_treated.webm" type="video/webm" />
                        <source src="Video/ogv/Task_2.4a_Host_treated.theora.ogv" type="video/ogg" />
                        <source src="Video/MP4/Task_2.4a_Host_treated.mp4" type="video/mp4" />
                    </video>

i am highly confused, any one help me?

I tried this, the src updating, but the video is not loaded, old video playing..
Jquery:

  $('#task2ResultVideo source').each(function (n,s) {
       $('#task2ResultVideo')[0].pause();
       $(this).attr('src',$(this).attr('src').replace('Task_2.4a_Host_treated', task2RslVideo));
       setTimeout(function(){
        $('#task2ResultVideo').load();
        },1000)
       alert($(this).attr('src').replace('Task_2.4a_Host_treated', task2RslVideo));
    } )
  • 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-13T12:58:39+00:00Added an answer on June 13, 2026 at 12:58 pm

    Basing off “Replacing media sequentially” at the Apple Developer site:
    http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html#//apple_ref/doc/uid/TP40009523-CH3-SW1

    In that document, it appears that Safari is looking for src on the video tag, itself, and not in the <source/> tags below it.

    What about, as a simple test, trying this to see if it works:

    // obviously, wrap this in a function... this is simply for testing,
    // as you'll want to refine this for use by other browsers as well,
    // if this works
    var $vid = $("#task2ResultVideo");
    var src = "Video/MP4/" + task2RslVideo + ".mp4";
    $vid.attr("src", src);
    $vid.get(0).load();
    $vid.get(0).play();
    

    Curious to see what results you get, as this seems to be a fairly common problem (I saw a lot of questions related to this in my Google searches, as well).

    Updated… of course it would fail, because the isn’t set, duh… my bad. Really, though, your replace is fragile as well, as it would work the first time (because it knows that ‘Task_2.4a_Host_treated’ exists) but after that, it wouldn’t have a match anymore. You should build up your src string from the components you know, rather than using replace, in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

new on rails and using windows for now,, i have web page that user
I have a web page that has multiple tabs, which all do basically the
I have a JSP page (home page) in a Web App, which has different
I used to have a UIWebView that links to our web page. This page
I have a page class for my web page. When this is called, it
While scrolling my web page a DIV which have a video is not going
I have many SWF file those I have included in my web page using
How do I put server-side webcam video on my web page? I'm using PHP,
I have a video as a background to a web page, and I am
Is it possible to have a YouTube video played on a web page in

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.