Player.controls.CurrentPosition (raw):
Raw Calculated Remaining Time (raw):
Player.currentMediaDuration (raw):
Playback Rate= (1 is normal, 2 is double speed, etc.) |
<OBJECT id="user defined object name for the player" width='360' height='270'
classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'
codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
standby='Loading Microsoft Windows Media Player components...'
type='application/x-oleobject'>
</OBJECT>
This code is placed on the web page. You decide on:
var Player=document.all.m1;
where the HTML object tag says:
<OBJECT id="m1" width...</OBJECT>
then in the subsequent lines you would say for example:
Player.uiMode="none";
The choice of the name "Player" and "m1" are arbitrary. They just as well could be "fred" and "alice".
Common player methods are (we use the arbitrary object name "Player"):
The player object has a group of settings specified in the player's setting object. Usage is:
Player.setting.setting property=value
Common player settings are (defaults are underlined):
The controls object is used to provide play controls for the media player. Usage is:
Player.controls.property();
Common player controls are:
There are a few really usable media object properties. Usage is:
Player.currentMedia.property;
The slider code used in this example is from SoftComplex.
The four HTML components are:
This is the image:
This is the image:
This is the image:
The HTML code to wire up the images and the javascript is:
<script language="JavaScript" src="slider.js"><'/script>
then on the HTML page are:
<input name="slider textbox name" size="3" id="slider textboxname" type="text" onchange="A_SLIDERS[0].f_setValue(this.value)">
The slider textbox name will be used below.
This script inserts the slider, and background on the page.
I have added a slider track using the one pixel black gif above. The HTML is:
<span style="position:absolute;Top:12px;Left:10px;z-index:8;">
In this example, the choice of the "top" and "left" properties centers the black track in the background image. Note that the slider has a z-index of 10 and the track has a z-index of 8 (thus the track appears behind the slider)
Here is the resulting example slider:
(a) The two structure names that appear in the javascript that define the parameters of the slider will appear as arguments in the "new slider".
(b) The textbox that contains the slider's value has both a "name" and an "id" attribute. They must be have the same value AND the value must appear in second structure as the value of "s_name".
In order to user multiple sliders on the same page:
Use a different name/id for each slider textbox. Be sure to change the name in the second structure where the slider is created as the "s_name" value. Then, note in the reference "A_SLIDERS[some_number]"
<input name="slider textbox name" size="3" id="slider textboxname" type="text" onchange="A_SLIDERS[some_number].f_setValue(this.value)">
Here some_number is the sequence number of the slider on the page (the first is zero, the second is one,...). Note that the third slider on this page (the example above) is slider number 2.
Videos here are wmv formatted from youtube.com
. It is 16 pixels wide and 20 pixels tall. Click here to download the image.
. It is 120 pixels wide and 28 pixels tall. Click here to download the image.
. It is 1 pixels wide and 1 pixels tall -- but displayed here as 20 by 20. Click here to download the image.
<script language="javascript">
var some_structure_name_1 =
{
'b_vertical' : false, //*** vertical is true ;horizontal if false
'b_watch': true, //*** continuously update while moving if true
'n_controlWidth': 120, //*** width of the background image
'n_controlHeight': 28, //*** height of ther background image
'n_sliderWidth': 16, //*** width of the slider
'n_sliderHeight': 20, //*** height of the slider
'n_pathLeft' : 2, //*** slider offset from the left side of the background
'n_pathTop' : 4, //*** slider offset from the top of the background
'n_pathLength' : 100, //*** width (r height) of the slider movement distance
's_imgControl': 'vidbutback.jpg', //*** background image name
's_imgSlider': 'vidbut.jpg', //*** slider image name
'n_zIndex': 10 //*** z-index
}
var some_structure_name_2 =
{
's_form' : 'vcform', //*** name (or number) of the form containing the slider
's_name': 'slider textbox name', //*** name/id of the slider (slider textbox name above)
'n_minValue' : -100, //*** minimum value the slider will attain when moved all the way to the left
'n_maxValue' : 100, //*** maximum value the slider will attain when moved all the way to the right
'n_value' : 0, //*** initial value the slider (between the two value above)
'n_step' : 1 //*** precision of the slider movemnt
}
new slider(some_structure_name_1,some_structure_name_2);
</script>
<img src="black1x1.gif" height="2" width="100"></span>