How to add a fullscreen button in html?

  • itachi143
  • Born
  • Born
  • itachi143
  • Posts: 1

Post 3+ Months Ago

Hello, I made a website and I put an html code to add videos with a media player. It's a windows media player but it doesn't have a fullscreen button, it'll only go to fullscreen if you double click the video. I want the player to have a button that makes it fullscreen, does anyone know a code for that in html without having to download anything?

Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Poly
  • Guru
  • Guru
  • User avatar
  • Posts: 1091
  • Loc: Same place you left me.

Post 3+ Months Ago

You need to first check to see if the video is playing before you allow somebody to go to full screen. So check the video state with:
Code: [ Select ]
if (player.DisplaySize==3)


Then if the video is playing you allow it to go to full screen with:
Code: [ Select ]
player.fullScreen=true;


Full copy of the code is below. And just as an FYI if it wasn't obvious, this is Javascript code. Implementation is up to you.


Code: [ Select ]

function fullScreen()

{
  var player=document.getElementById("Player");
  if (player.DisplaySize==3)
 {
   player.fullScreen=true;
  }
}
  1. function fullScreen()
  2. {
  3.   var player=document.getElementById("Player");
  4.   if (player.DisplaySize==3)
  5.  {
  6.    player.fullScreen=true;
  7.   }
  8. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 42 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.