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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:38:45+00:00 2026-05-25T20:38:45+00:00

I have embeded a few videos which I need to display if a link

  • 0

I have embeded a few videos which I need to display if a link is clicked. so what I am trying to do is click a link and it will display a video, which the user can press play on. If they click another link, the previous video stops and a new video will be displayed. The current HTML structure I have is:

<div>
    <ul>
        <li><a onclick="ShowVideo(0);" href="javascript:void(0);" class="CalltrackLink">Missed Opportunities</a></li>
        <li><a onclick="ShowVideo(1);" href="javascript:void(0);" class="CalltrackLink">Create User</a></li>
    </ul>
</div>
<div>
    <div id="Video1Div" style="display:none">
        <OBJECT id="Video1" width="640" height="480" 
        STANDBY="Loading Windows Media Player components..." 
        CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
        type="application/x-oleobject">

            <PARAM NAME="URL" VALUE="Video1.mp4" />
            <PARAM NAME="SendPlayStateChangeEvents" VALUE="True" />
            <PARAM NAME="AutoStart" VALUE="False" />
            <PARAM NAME="ShowControls" value="True" />

        </OBJECT>
    </div>
    <div id="Video2Div" style="display:none">
        <OBJECT id="Video2" width="640" height="480" 
        STANDBY="Loading Windows Media Player components..." 
        CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
        type="application/x-oleobject">

            <PARAM NAME="URL" VALUE="Video2.mp4" />
            <PARAM NAME="SendPlayStateChangeEvents" VALUE="True" />
            <PARAM NAME="AutoStart" VALUE="False" />
            <PARAM NAME="ShowControls" value="True" />

        </OBJECT>
    </div>
</div>

I have the following javascript which I got from various sources on the internet:

function ShowCalltrack(i) {
    $('#Video1Div').hide();
    $('#Video2Div').hide();

    document.getElementById("Video1Div").controls.stop();    
    document.getElementById("Video2Div").controls.stop();

    if(i == 0)
    {
        $('#Video1Div').show();
    }
    else if(i == 1)
    {
        $('#Video2Div').show();
    }
}

When I run this I get the error:

Unable to get value of the property ‘stop’: object is null or undefined

If I remove the offending code then, when the user clicks another link the previous video will still be playing, and you can hear the audio, if the user did not manually stop the video.

I was able to stop the previous video by using this code:

var Video1 = document.getElementById("Video1Div");
var Video1Text = Video1.innerHTML;
Video1.innerHTML = '';
Video1.innerHTML = Video1Text;

this does stop the video from playing, however, the problem with this is, if you go back to a link which you had previously opened the video will resume from where it left off with previously, and I need to to start again from the start.

Any ideas?

  • 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-05-25T20:38:46+00:00Added an answer on May 25, 2026 at 8:38 pm

    Your addressing the DIV element, not the control which has ID Video1;

    var Wmp = document.getElementById("Video1");
    if (Wmp.controls.isAvailable('Stop'))
       Wmp.controls.stop();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few links on my site that will need to show a
Hi I have a plugin.dll which contains this all npp functions I have embeded
I have a .swf banner embeded on my xhtml and I need it to
I have one flash file which is embading in another, the embeded one is
I have a few thousand word files which some of my colleagues have put
Im writing a page that will display a video, and on playback completion, will
I have an embedded silverlight video player on our site, which is loaded in
I have a few questions regarding android market(Google play). How can I list my
I have an iframe which contains a few select drop-down lists for data entry.
I have a Delphi application which contains a manifest file with a few dependencies

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.