/    Sign up×
Community /Pin to ProfileBookmark

video object dimensions width height

Hi,

Im trying to embed various video clips in a html page using Windows Media Player. There is one video window and I want to be able to use buttons to change the video clip playing in that window. All is going well: the video is working and I can use javascript to jump between different video clips.

However, I want the video window to be a particular width and height. I can set the size in the EMBED and OBJECT tags, and as long as the original video is playing, the video retains these dimensions. But when I change the clip that is playing the video window jumps to a new size and all subsequent videos play at that size as well.

I have tried re-setting the video dimensions in the code after I have changed the video

Eg: video1.width = 819

Although the video window will jump to the new size for a split second, it immediately reverts to the seemingly default settings of 352 x 288.

I am really pulling my hair out over this and cant find anything about it anywhere.

Can anyone please help?

Thanks in advance … theSquirrel

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliDec 06.2003 — post a link to thepage wher eyou have this implemented...

My guess will be to use

video1.setAttribute("width","600");

but if I see the code, might be in a position to offer a better solution.
Copy linkTweet thisAlerts:
@theSquirrelauthorDec 09.2003 — thanks Khalid ...

http://www.espresso.co.uk/cai_test/game/activity_storyboard.html

The page uses a combination of Flash and HTML layers. The Flash is on one layer. The video is on another layer.

All the video controls are in the Flash but all they do is call Javascript functions in the HTML page. So the Flash is of no real consequence.

The images at the bottom of the Flash movie change the video clips. This is done through this Javascript function:

function changeVideo(tVideo) {

var TheVideo = TheVideos[tVideo];

if (BrowserName == "Netscape Navigator") {

document.video1.FileName = TheVideo;

document.video1.SetDisplaySize(0);

document.video1.SetRate(1);

document.video1.AutoStart = 0;

} else {

video1.FileName = TheVideo;

video1.FullScreenMode = 0;

video1.rate = 1;

video1.AutoStart = 0;

video1.width =500;

video1.height = 500;

}

}

By the way, I tried "video1.setAttribute("width","600");" and it didnt make any difference.

Thanks again for your help ...

theSquirrel
Copy linkTweet thisAlerts:
@theSquirrelauthorDec 10.2003 — anyone??
×

Success!

Help @theSquirrel 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.8,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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