Avatar billede fredand Forsker
03. april 2001 - 09:47 Der er 4 kommentarer og
1 løsning

Ask Mediaplayer to play avi-file faster!

Hola amigos!

I need to play an avi file a bit faster, for e.g. 2*times and 4*times faster, from an webpage with js.

My code so far is (just the importent):

Webpage:
            <object classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" id=\"v1\">
              <param name=\"FileName\" value=\"video/birthday.mpe\"/>
              <param name=\"DisplaySize\" value=\"1\"/>
              <param name=\"AutoStart\" value=\"false\"/>
              <param name=\"PlayCount\" value=\"0\"/>
              <param name=\"ShowTracker\" value=\"false\"/>
              <param name=\"ShowControls\" value=\"false\"/>
            </object>

Js-file (takes action when the user push button b12):
function v1Play()
{
    //v1.play(); plays the file v1 normaly
Needs some code to tell the mediaplayer to play faster!

}

window.document.all.b12.onclick = v1Play;

Best regards!

Fredrik
Avatar billede nikolajdu Nybegynder
03. april 2001 - 12:43 #1
I have never heard that you can actually get Mediaplayer to play faster. E.g. you suddenly needed to download twice the amount instead of normal constant streaming content.
Avatar billede shaman Nybegynder
05. april 2001 - 10:20 #2
Sounds to me like the easiest thing to do is to have several media files at different speeds. I\'ve never heard that you could make media player play faster either...
Avatar billede nikolajdu Nybegynder
24. april 2001 - 04:53 #3
Fredand - Have you lost contact to earth??
Avatar billede fredand Forsker
24. april 2001 - 09:38 #4
Hola Amigos!

I found out how to do this!

You have to manipulate a member called rate in Mediaplayer, like this:

1)Play twice as fast:
mediaplayer.Rate = 2;
mediaplayer.play();

2)Play twice as slow:
mediaplayer.Rate = 0.5;
mediaplayer.play();

Best Regards
Fredrik

Avatar billede nikolajdu Nybegynder
24. april 2001 - 15:53 #5
Try this then.

<html>
<head>
<script>
function callMp(playRate){
  document.formy.v1.Rate = eval (playRate);
  document.formy.v1.play();
}
</script>
<head>
<body>

<form name=\"formy\">
<object classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" id=\"v1\">
              <param name=\"FileName\" value=\"video/birthday.mpe\"/>
              <param name=\"DisplaySize\" value=\"1\"/>
              <param name=\"AutoStart\" value=\"false\"/>
              <param name=\"PlayCount\" value=\"0\"/>
              <param name=\"ShowTracker\" value=\"false\"/>
              <param name=\"ShowControls\" value=\"false\"/>
            </object>

<input type=\"button\" value=\"half the speed\" onClick=\"callMp(0.5);\">
<input type=\"button\" value=\"twice as Fast\" onClick=\"callMp(2.0);\">
</form>

</body>
<html>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester