473,563 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ 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="MediaP layer.controls. play();"
type="button"
size="22"
value="Play">

<INPUT type = "button"
value = "Full Screen"
name = BUTTON
onclick = "if (MediaPlayer.pl ayState == 3)
MediaPlayer.ful lScreen = '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 9878
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="MediaP layer.controls. play();"
type="button"
size="22"
value="Play">

<INPUT type = "button"
value = "Full Screen"
name = BUTTON
onclick = "if (MediaPlayer.pl ayState == 3)
MediaPlayer.ful lScreen = '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.pla yState) {
MediaPlayer.ful lscreen = 'true';
}
MediaPlayer.con trols.play();
}
</SCRIPT>

...and this BUTTON to your document:

<BUTTON type="button" onclick="playFu llscreen()"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.pla yState? 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.******@blueyo nder.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.pla yState) {
MediaPlayer.ful lscreen = 'true';
} else {
MediaPlayer.con trols.play();
if (!stateTimer) stateTimer =
window.setInter val( 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.pla yState) {
window.clearInt erval( stateTimer );
stateTimer = null;
MediaPlayer.ful lscreen = 'true';
}
}
</SCRIPT>

and the following in the body:

<BUTTON type="button" onclick="playFu llscreen()"
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
2279
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 below). I have set the button's "Triple State" value to Yes, and the default value to False. Here is the macro that I used for tglName (I assigned the...
3
1928
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, you will be an integral part of taking a first genereation product to production. You will play a key role to define, implement, and maintain the QA...
2
2856
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 and then it stops. When I refresh the page, it works fine. Not sure what to think here about this. Any ideas?
1
2510
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. The problem is this. Although Firefox recognise the quicktime object as a HTMLObjectElement, it does not give me access to it methods from within...
3
1482
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, I want the player to close, then the form to close. I am new and learning little by little, thanks in advance for your help
3
4013
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 please post it for me. i would really appriciate it if anyone can give me hand on this. thank you CODe in HTML HEAD <SCRIPT...
2
1382
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 = document.getElementById("pathStore").getAttribute("value"); player.URL = myURL; alert(player.URL);
8
14928
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 cut and paste code that MSDN recommends for playing a simple wav file from inside an embedded file, like presumeably the 'resources' file .resx is. ...
0
1086
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 media player is maximised,& when we click on ESC Button, Media player is minimsed.......But I m nota ble to achiev that.. Secondly I do not know that...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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 we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.