i want to make a button that will start an embedded windows media
player playing AND in full screen. i can do it with TWO buttons:
<input
onclick="MediaPlayer.controls.play();"
type="button"
size="22"
value="Play">
<INPUT type = "button"
value = "Full Screen"
name = BUTTON
onclick = "if (MediaPlayer.playState == 3)
MediaPlayer.fullScreen = 'true';">
but i would like to be able to combine this into ONE button. seems
simple enough but after a week of experimenting, i just can't figure
it out.
thanks,
craig
|
|
0
|
|
|
|
Reply
|
cskelly
|
12/14/2003 12:59:17 AM |
|
craig wrote on 14 Dec 2003 at Sun, 14 Dec 2003 00:59:17 GMT:
> i want to make a button that will start an embedded windows
> media player playing AND in full screen. i can do it with TWO
> buttons:
>
> <input
> onclick="MediaPlayer.controls.play();"
> type="button"
> size="22"
> value="Play">
>
> <INPUT type = "button"
> value = "Full Screen"
> name = BUTTON
> onclick = "if (MediaPlayer.playState == 3)
> MediaPlayer.fullScreen = 'true';">
>
> but i would like to be able to combine this into ONE button.
In the document HEAD, add this:
<SCRIPT type="text/javascript">
function playFullscreen() {
if (3 == MediaPlayer.playState) {
MediaPlayer.fullscreen = 'true';
}
MediaPlayer.controls.play();
}
</SCRIPT>
...and this BUTTON to your document:
<BUTTON type="button" onclick="playFullscreen()"
>Play fullscreen</BUTTON>
I can't test this, but there should be no reason why it won't work.
What is 3 as a value of MediaPlayer.playState? Does it impact whether
the video should be played, or only if it can or can't be changed to
fullscreen. Does the video need to be playing before it's changed to
fullscreen, or should the fullscreen happen first? You'll have to
decide, based on the answers to those questions, whether the play()
call should be inside the if statement, before it, or after it.
Hope that helps,
Mike
--
Michael Winter
M.Winter@blueyonder.co.invalid (replace ".invalid" with ".uk")
|
|
0
|
|
|
|
Reply
|
Michael
|
12/14/2003 2:03:45 AM
|
|
thanks for the reply michael. i am contacting you directly via email.
your solution apparently only works if the button is pressed twice,
which does get me closer than before but it also makes me think the
real solution is simple and close. if anyone else has any ideas
please post them here. as soon as i get a solution i will post it
here and hopefully it will help someone else in the future.
craig
|
|
0
|
|
|
|
Reply
|
cskelly
|
12/15/2003 11:01:18 PM
|
|
thanks to mike, I GOT IT. the following code in the header:
<SCRIPT type="text/javascript">
var stateTimer = null;
function playFullscreen() {
// Check if the video is playing. If it is, change
// to fullscreen. If not, start checking to see when
// it is.
if (3 == MediaPlayer.playState) {
MediaPlayer.fullscreen = 'true';
} else {
MediaPlayer.controls.play();
if (!stateTimer) stateTimer =
window.setInterval( checkState, 500 );
}
}
function checkState() {
// Check periodically to see if the video has
// started. If so, destroy the timer and change to
// fullscreen
if (3 == MediaPlayer.playState) {
window.clearInterval( stateTimer );
stateTimer = null;
MediaPlayer.fullscreen = 'true';
}
}
</SCRIPT>
and the following in the body:
<BUTTON type="button" onclick="playFullscreen()"
>Play fullscreen</BUTTON>
did the trick! thanks mike, you're a true guru.
craig
|
|
0
|
|
|
|
Reply
|
cskelly
|
12/16/2003 2:12:06 AM
|
|
|
3 Replies
609 Views
(page loaded in 0.043 seconds)
Similiar Articles: embedded WMP, button to play in full screen - comp.lang.javascript ...i want to make a button that will start an embedded windows media player playing AND in full screen. i can do it with TWO buttons: but i would... Display does not cover the entire screen - comp.unix.solaris ...embedded WMP, button to play in full screen - comp.lang.javascript ... Display does not cover the entire screen - comp.unix.solaris ... embedded WMP, button to play in ... Playing DVDs on the secondary monitor of an Extended Desktop ...embedded WMP, button to play in full screen - comp.lang.javascript ... Playing DVDs on the secondary monitor of an Extended Desktop ... embedded WMP, button to play in ... Dolby 5.1 in Itunes - comp.sys.mac.systemembedded WMP, button to play in full screen - comp.lang.javascript ... Dolby 5.1 in Itunes - comp.sys.mac.system embedded WMP, button to play in full screen - comp.lang ... play DVD-Audio discs? - comp.sys.mac.appsembedded WMP, button to play in full screen - comp.lang.javascript ... play DVD-Audio discs? - comp.sys.mac.apps embedded WMP, button to play in full screen - comp.lang ... Embedded graphics from external mail system don't show - comp ...embedded WMP, button to play in full screen - comp.lang.javascript ... Embedded graphics from external mail system don't show - comp ... embedded WMP, button to play in ... Direct Sunlight on Monitor Screen - comp.sys.mac.appsembedded WMP, button to play in full screen - comp.lang.javascript ... Direct Sunlight on Monitor Screen - comp.sys.mac.apps embedded WMP, button to play in full screen ... Fullscreen - comp.graphics.api.openglembedded WMP, button to play in full screen - comp.lang.javascript ... i want to make a button that will start an embedded windows media player playing AND in full screen ... How do I close iTunes "Now Playing" window? - comp.sys.mac.apps ...embedded WMP, button to play in full screen - comp.lang.javascript ... How do I close iTunes "Now Playing" window? - comp.sys ... embedded WMP, button to play in full ... Start file download using onclick... - comp.lang.javascript ...Start file download using onclick... - comp.lang.javascript ... embedded WMP, button to play in full screen - comp.lang.javascript ... i want to make a button that will ... embedded WMP, button to play in full screen - comp.lang.javascript ...i want to make a button that will start an embedded windows media player playing AND in full screen. i can do it with TWO buttons: but i would... Re: Play embedded video in Full Screen modeI have an embedded .wmv video (which runs using Media Player) on my site. I want to let users watch the video in full screen but Media Player doesn't show the button ... 7/20/2012 4:10:10 AM
|