Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

.mpg file in HTML

When click the Text it link to .mpg file.New Branch Has Opened when I click this text it will play tte .mpg file.

How to do this.
Thanks
0
KavyaVS
Asked:
KavyaVS
  • 3
  • 2
2 Solutions
 
KavyaVSAuthor Commented:
I tried this.
<p class="prbody"><embed src="../images/BranchOpened.mpg"
 autostart="false" hidden="false"/>
 Branch Opened
</p>

It is playing the video file. but it is not linked to Text.
The file now is visible. I want it like this,the file should be hidden and only when we click the Branch Opened text
it should play the video.

How to do that.

Thanks.
0
 
scifo_dkCommented:
You can do this two ways.

1. Is with some scripting language like javascript or php,

2. is to have two html pages.

The second one, requires less programming skills, and can be done like this:

Create a file containing the following code:
<html>
<body>
<a href="video_site.html">Branch Opened</a>
</body>
</html>

Open in new window


Then create another file in the same folder named "video_site.html" with the following code:
<html>
<body>
<p class="prbody"><embed src="../images/BranchOpened.mpg"
 autostart="false" hidden="false"/>
 Branch Opened 
</p>
</body>
</html>

Open in new window


Now you can open the first webpage you made, click the link, and it takes you to the movie site.

This is a bit oversimplified, but its just to make you see the idea.

Hope this helps.

//Scifo_dk
0
 
scifo_dkCommented:
I came to think of this aswell, if it's only that element, you can do it with CSS like this:
<html>
<body>

<script>
function showit() {
if (document.getElementById) document.getElementById("video").style.visibility = "visible";
else if (document.all) document.all.minAvis.style.visibility = "visible";
else if (document.layers) document.minAvis.visibility = "show";
}
</script>

<div id="video" style="visibility: hidden;">
<p class="prbody"><embed src="../images/BranchOpened.mpg"
 autostart="false" hidden="false"/>
</p>
</div>

<br><br>
<a href="#" onClick="showit();">Branch Opened</a>

</body>
</html>

Open in new window

0
 
KavyaVSAuthor Commented:
I am using .aspx pages. I can't use separate html page.
I can use the javascript.I tried the function show it. but it is not working. Can you give me an idea why it is not working.
When I clicked the text nothing is showing up.
Thanks.
0
 
scifo_dkCommented:
hmm, what browser are you using?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now