Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Centering your Video


Hello! Jeroen, I love your awesome video tutorials! I've finally found what I was looking for because of you! Thank you so much. Anyway, I have a simple question: I was wondering how to center the video on the page. There should be a simple code for that, right? Thanks a lot guys!

21 Community Answers

JW Player

User  
0 rated :

Anyone have any idea how to center a video?

JW Player

User  
0 rated :

do you mean center the whole player, or center the video within the player???

simple and crude would be to just in-line style the divbc.. <div id="player" style="text-align:center">


for more involved centering, including vertical centering, use Google "CSS Center" to find examples and tutorials like this: [url=http://www.w3.org/Style/Examples/007/center]Web Style Sheets CSS tips & tricks Centering Things[/url]

JW Player

User  
0 rated :

Yes, I mean center the player! Thanks a lot man! I appreciate it. :D

JW Player

User  
0 rated :

Yes, I just used that code and it works dandy! You guys rock. :D

JW Player

User  
0 rated :

Change from the WYSIWYG- to the XHTML-Editor and put your video between two Center-Tags:

<center>
[flv:http://bluesdiary.com/wp/video/Gary_Moore_-_Story_Of_The_Blues.flv 320 240]
<p style="TEXT-ALIGN: center">
*Gary Moore - Story Of The Blues*
</p>
</center>

You can watch it live here:

http://blogorama.eisbrecher.net/2008/05/11/mein-freund-kuno-ist-tot/

Happy Blogging!

Rudi
http://blogorama.eisbrecher.net

JW Player

User  
0 rated :

what about centering the rotator? I tried <center> and <div> tags with no luck. Anybody know how to center the imagerotator alone?

JW Player

User  
0 rated :

I also tried putting the image rotator script calls inside a centered table. still no luck. Any help would be greatly appreciated!

JW Player

User  
0 rated :

It's embedded in a page with a lot of other stuff. The page's body element currently has text-align: left. Do I have to change the body tag? Is there no way I can put another tag around it?

JW Player

User  
0 rated :

Hmmm. Tried changing the body tag to text-align:center but that didn't seem to help either. Could it be because this is an old table-layed out site? Here's the page I'm working on:
http://www.aashe.org/index_rotator.php

JW Player

User  
0 rated :

Aha! I finally figured it out. I was wrapping my <div> and <table> tags around the <script> tags. But, I was not putting the <div id="container"> tag inside them too. As soon as I put the <div id="container"> tag inside the tags suggested above, everything worked like a charm.

Thanks for everyone's help here.

JW Player

User  
0 rated :

so this is my code

<script type='text/javascript' src='jw/swfobject.js'></script>
<script type="text/javascript">
var so = new SWFObject('jw/player.swf','mpl','800','250','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=jw/sports.xml&backcolor=000000&frontcolor=565556&playlistsize=400&playlist=right&');
so.write('player');
</script>



how do i center it?

JW Player

User  
0 rated :


You apply CSS to the HTML element with an id of "player" to position the player. Read the previous posts in this thread for the details.

JW Player

User  
0 rated :

i have tried everything but i cant. im not great with code

JW Player

User  
0 rated :


@nick,

The best way (and about the only way) to get useful, effective help, is to post a link to your Test Page. We can't guess.

JW Player

User  
0 rated :

i dont really have a test page. i guess i might just have to play around with it. thanks for trying to help though

JW Player

User  
0 rated :


Well then post the entire HTML document that you have, including the HTML element with an id of "player" that you are writing your Flash content into.

JW Player

User  
0 rated :

Thank you for trying to help me





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Public Meetings</title>
<link href="sit.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
<!--
.style2 {font-size: 72px}
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
a:link {
color: #FFFFFF;
}
a:visited {
color: #FFFFFF;
}
-->
</style>
</head>
<body>
<p align="center"><a href="http://www.ellsworthschools.org/streaming" class="style2">HCTC TV5 <img src="img/RSU24Logo.jpg" alt="" width="136" height="56" align="bottom" /></a>
<p align="center"><a href="index.html">Home</a> | <a href="meetings.html">Meetings</a> | <a href="concerts.html">Concerts</a> | <a href="sports.html">Sports</a> | <a href="classroom.html">Classroom</a> | <a href="#" onclick="MM_openBrWindow('contactus.html','','width=500,height=500')">Contact us</a> | <a href="http://fc.ellsworthschools.org/~bspeed/FOV1-0001A7D0/Welcome.html" target="_blank">TV/Video Production Web Site</a><br />
If you can't see a video on this page you need <a href="http://get.adobe.com/flashplayer/">Adobe Flash Player</a>
<P align="center">Home Page</P>
<div id="player">
<p align="center"></p>
</div>


<div align="center">
<script type='text/javascript' src='jw/swfobject.js'></script>
<script type="text/javascript">
var so = new SWFObject('jw/player.swf','mpl','800','250','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=jw/index.xml&backcolor=000000&frontcolor=565556&playlistsize=400&playlist=right');
so.write('player');
</script>
<br />
</div>
</div>
<div id="bar">
<div align="center"><img src="img/bar.jpg" width="800" height="6" /></div>
</div>
<div align="center"><br />
</div>
<div id="bootom">
<div>
<p align="center"><a href="index.html">Home</a> | <a href="meetings.html">Meetings</a> | <a href="concerts.html">Concerts</a> | <a href="sports.html">Sports</a> | <a href="classroom.html">Classroom</a> | <a href="#" onclick="MM_openBrWindow('contactus.html','','width=500,height=500')">Contact us</a> | <a href="http://fc.ellsworthschools.org/~bspeed/FOV1-0001A7D0/Welcome.html" target="_blank">TV/Video Production Web Site</a><br />
If you can't see a video on this page you need <a href="http://get.adobe.com/flashplayer/" target="_blank">Adobe Flash Player</a> </p>
</div>
</div>
<div align="center"><br />
</div>
<p align="center"> </p>
</body>
</html>

JW Player

User  
0 rated :

thank you sooo much

JW Player

User  
0 rated :


You're welcome.

*_Enjoy_*

JW Player

User  
0 rated :

bc.. <body style="text-align:center;">
<div id="rotator" style="margin:0 auto; display:block;">

<!-- your rotator here -->

</div>
</body>


hope it helps!

salutes!

JW Player

User  
0 rated :


bc.. <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<head>

<title>PublicMeetings</title>

<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"/>

<linkhref="sit.css"rel="stylesheet"type="text/css"/>

<scripttype="text/javascript">
<!--
functionMM_openBrWindow(theURL,winName,features)//v2.0
{
window.open(theURL,winName,features);
};
//-->
</script>

<styletype="text/css">
<!--
.style2{font-size:72px}

body,td,th
{
color:#FFFFFF;
}

body
{
background-color:#000000;
}

a:link
{
color:#FFFFFF;
}

a:visited
{
color:#FFFFFF;
}

div.player
{
text-align:center;
}
-->
</style>

<scriptsrc="jw/swfobject.js"></script>

</head>

<body>

<palign="center">
<ahref="http://www.ellsworthschools.org/streaming"class="style2">HCTCTV5<imgsrc="img/RSU24Logo.jpg"alt=""width="136"height="56"align="bottom"/></a>
</p>
<palign="center">
<ahref="index.html">Home</a>|<ahref="meetings.html">Meetings</a>|<ahref="concerts.html">Concerts</a>|<ahref="sports.html">Sports</a>|<ahref="classroom.html">Classroom</a>|<ahref="#"onclick="MM_openBrWindow('contactus.html','','width=500,height=500')">Contactus</a>|<ahref="http://fc.ellsworthschools.org/~bspeed/FOV1-0001A7D0/Welcome.html"target="_blank">TV/VideoProductionWebSite</a>
</p>
<palign="center">
HomePage
</p>
<divid="player"class="player">Ifyoucan'tseeavideoonthispageyouneed<ahref="http://get.adobe.com/flashplayer/">AdobeFlashPlayer</a></div>
<divid="bar">
<divalign="center">
<imgsrc="img/bar.jpg"width="800"height="6"/>
</div>
</div>
<divid="bottom">
<div>
<palign="center">
<ahref="index.html">Home</a>|<ahref="meetings.html">Meetings</a>|<ahref="concerts.html">Concerts</a>|<ahref="sports.html">Sports</a>|<ahref="classroom.html">Classroom</a>|<ahref="#"onclick="MM_openBrWindow('contactus.html','','width=500,height=500')">Contactus</a>|<ahref="http://fc.ellsworthschools.org/~bspeed/FOV1-0001A7D0/Welcome.html"target="_blank">TV/VideoProductionWebSite</a>
</p>
</div>
</div>

<scripttype="text/javascript">
varso=newSWFObject('jw/player.swf','mpl','800','250','9.0.124');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('file','jw/index.xml');
so.addVariable('backcolor','000000');
so.addVariable('frontcolor','565556');
so.addVariable('playlist','right');
so.addVariable('playlistsize','400');
so.write('player');
</script>

</body>

</html>



This question has received the maximum number of answers.