/    Sign up×
Community /Pin to ProfileBookmark

Custom Controls for media player

Hello all, first post ?
I have a custom player that I embed windows media files in. I have been using this script for awhile now but only recently added custom controls for volume and I am getting a “object or method not supported” error when I click the volume controls. I was hoping someone could help me spot the error in my code. Is this code outdated, or am I using the wrong command for volume? Any help appreciated. Thanks again

Here is the code (also attached in notepad)
———————————————————-

In Head of Doc
———————

<script language=”javascript”>
var bolIsPlaying;
var intVolumeBarState=4;

function videoFullScreen()
{
objMediaPlayer.DisplaySize=3;
}

function videoPlay()
{
objMediaPlayer.Play();
bolIsPlaying = true;
}

function videoStop()
{
objMediaPlayer.Stop();
bolIsPlaying = false;
}

function videoPause()
{
if(bolIsPlaying)
objMediaPlayer.Pause();
}

function videoFastReverse()
{
if(bolIsPlaying)
objMediaPlayer.FastReverse();
}

function videoFastForward()
{
if(bolIsPlaying)
objMediaPlayer.FastForward();
}

function setVolume(intVolume)
{
intVolume=((intVolume-8)*1250);
objMediaPlayer.Volume=intVolume;
}

function videoVolumeIncrease()
{
if(bolIsPlaying)
objMediaPlayer.VolumeIncrease();
}

function videoVolumeDecrease()
{
if(bolIsPlaying)
objMediaPlayer.VolumeDecrease();
}

function applicationLoad()
{
objMediaPlayer.Volume=0 // sets the volume equal to 50% of max volume. The corresponding divs are already set to the correct background colors, which is why volume change is not called here.
}
</script>

Commands on the img buttons
——————————

onClick=”videoFastReverse()”>
onClick=”videoStop()”>
onClick=”videoPlay()”>
onClick=”videoPause()”>
onClick=”videoFastForward()”>
onClick=”videoFullScreen()”>
onClick=”videoVolumeIncrease(300)”>
onClick=”videoVolumeDecrease(300)”>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@SolaceauthorMar 03.2004 — Unfortunately it didnt have what I was looking for, but thanks for the post Kor.
×

Success!

Help @Solace spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...