472,352 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

embedded WMP, button to play in full screen

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
Jul 20 '05 #1
3 9805
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.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #2
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
Jul 20 '05 #3
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
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 3 toggle buttons (1 of which is tglName, which I will be using to demonstrate my problem). The...
3
by: +++ | last post by:
!!!! QA ENGINEER FOR EMBEDDED SYSTEMS, OPTICAL FRONT END!!!! City: CA- San Jose Salary: Full Time- Open Job Description: Responsibilities ...
2
by: codepuller | last post by:
I have a embedded media player into an ASP.NET web page and it all works except for the first time the page loads, when the user clicks on the play...
1
by: torbs | last post by:
I have an defined an object with a method called loadMovie that use a method - SetUrl- in an embedded quicktime object. It is embedded using the...
3
by: john piper | last post by:
I want to place a button on a form. what I want is to have it as an exit button, however when a user clicks on the button I want to play a video...
3
by: simbat | last post by:
hello guys, i am experiencing some difficulty making a full screen button for my streaming video. i have the following code in my page. but it...
2
by: gsauns | last post by:
I have a Windows Media Player control embedded in my page. This is the code I use to get it to play: function setPlayerURL() { player =...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the...
0
by: sonia.sardana | last post by:
I have two buttons Play & Full Screen. If u click on Play Button,Movie starts..Movie Starts within 15-20 Seconds.....When u clik on Full Screen...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.