473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 9868
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 buttons are used to sort the form (explanations...
3
by: +++ | last post by:
!!!! QA ENGINEER FOR EMBEDDED SYSTEMS, OPTICAL FRONT END!!!! City: CA- San Jose Salary: Full Time- Open Job Description: Responsibilities Working in the DVD arena with Blue Lazer technology,...
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 button, the player acts like it is going to 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 object tag, but I have also tried the embed tag. ...
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 file (full Screen) then when the video is complete,...
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 doesn't seem to work. if you have a code thats working...
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 = document.getElementById("wmpWindow"); myURL =...
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 Express version, which does not. I am trying to...
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 Button.,Media Player is Maximised. I want the if the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.