View Full Version : Playing Videos
evopanop
12-31-2006, 04:39 PM
Well, I've got videos working now... after finally finding a program that works on a Mac, that can convert videos to FLV format. (If you're on a Mac and need a program for this, then try FFmpegX (http://www.ffmpegx.com). I love it!)
My only question now is... how do I get the videos I play to be centered? I'm looking over the source code of the JSP files in the video folder, and I just don't see how to get the videos that are played to be centered. (BTW, I'm viewing the source code for these pages in Dreamweaver 8) Any ideas from anyone? Maybe the devs? It'd be really appreciated if someone could help me figure this out, lol.
Also, what's the max resolution a video file can be when viewed on the Wii?
Thanks in advance, everyone! :)
dc3fanboy_nl
12-31-2006, 04:51 PM
That is simple evopanop,
To get the videos playing centered, you just open the player.jsp in the directory: C:\Program Files\Red Kawa\Media Center\software\Video\skins\Default. and than put this <center>
chek the code below:
<body bgcolor="#000000" style="margin:0px;"><center>
<object type="application/x-shockwave-flash" data="flowplayer.swf" width="800" height="520" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flowplayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" VALUE="#000000" />
<param name="flashvars" value="config={videoFile: '%2Fsoftware%2FVideo%2Fvideos%2F50+Cent+-+Candy+Shop+%28Feat.+Olivia%29.flv', initialScale: 'fit', loop: false}" />
</object>
evopanop
12-31-2006, 05:15 PM
That is simple evopanop,
To get the videos playing centered, you just open the player.jsp in the directory: C:\Program Files\Red Kawa\Media Center\software\Video\skins\Default. and than put this <center>
chek the code below:
<body bgcolor="#000000" style="margin:0px;"><center>
<object type="application/x-shockwave-flash" data="flowplayer.swf" width="800" height="520" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flowplayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" VALUE="#000000" />
<param name="flashvars" value="config={videoFile: '%2Fsoftware%2FVideo%2Fvideos%2F50+Cent+-+Candy+Shop+%28Feat.+Olivia%29.flv', initialScale: 'fit', loop: false}" />
</object>
DC3, what are viewing that source code in? In DW8 it looks nothing like the sample you're showing...
This is the source code that I'm getting in Dreamweaver 8:
<%@page import="redKawa.mediaCenter.video.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<!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=iso-8859-1" />
<title>Video</title>
<%
String videoFile = (String) request.getAttribute("videoFile");
String playerURL = "player.swf?video_file=" + URLEncoder.encode(request.getContextPath() + videoFile) + "&autoplay=true";
if (null == request.getAttribute("directoryError")) {
String width = (String) request.getAttribute("videoWidth");
String height = (String) request.getAttribute("videoHeight");
VideoSettings settings = (VideoSettings) request.getAttribute("settings");
String fullScreen = (String) settings.getFullscreen();
if ("off".equals(fullScreen)) {
%>
<style type="text/css">
body {
margin: 0;
background-color:#000000;
}
#player {
position: absolute;
background-color:#00FFFF;
top: <%=(480-Integer.parseInt(height))%>px;
left: <%=(640-Integer.parseInt(width))%>px;
}
</style>
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<%=width%>" height="<%=height%>" id="player">
<param name="movie" value="<%=playerURL%>" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<embed src="<%=playerURL%>" quality="best" bgcolor="#000000" width="<%=width%>" height="<%=height%>" name="player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<% } else {
int iWidth = Integer.parseInt(width);
int iHeight = Integer.parseInt(height);
double aspect = (double)iWidth/(double)iHeight;
double newHeight = 640/aspect;
int iNewHeight = (int)newHeight;
String fullWidth = "640";
String fullHeight = Integer.toString(iNewHeight);
%>
<style type="text/css">
body {
margin: 0;
background-color:#000000;
color:#FFFFFF;
}
#player {
position: absolute;
background-color:#00FFFF;
top: <%=((480-iNewHeight)/2)%>px;
left: 0px;
}
</style>
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<%=fullWidth%>" height="<%=fullHeight%>" id="player">
<param name="movie" value="<%=playerURL%>" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<embed src="<%=playerURL%>" quality="best" bgcolor="#000000" width="<%=fullWidth%>" height="<%=fullHeight%>" name="player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<%
}
} else {%>
</head>
<body>
<h1>Video Not Found</h1>
<% } %>
</body>
</html>
dc3fanboy_nl
12-31-2006, 05:32 PM
Oh wait you run a MAC, that's why, I use a PC.
Oke no problem atall, that is the file.
try to put <center> this in your code and let me know if your video play in centered :)
Look at the code where I have put the <center>
</head>
<body>
<center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<%=fullWidth%>" height="<%=fullHeight%>" id="player">
<param name="movie" value="<%=playerURL%>" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<embed src="<%=playerURL%>" quality="best" bgcolor="#000000" width="<%=fullWidth%>" height="<%=fullHeight%>" name="player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<%
}
} else {%>
</head>
<body>
<h1>Video Not Found</h1>
<% } %>
</body>
</html>
evopanop
12-31-2006, 05:50 PM
Nope, didn't work... :( *sigh*
dc3fanboy_nl
12-31-2006, 07:27 PM
Verry strange I think because you have a MAC, verry strange.
I have make a screenshot below, I let you see that I don't lie to you:
http://img292.imageshack.us/img292/5325/nncu1.jpg
evopanop
01-01-2007, 01:24 AM
That is strange... even the control bar for your flash player is different than mine. Could be the difference between the PC and Mac FLV codec and player. Think you could post the entire source code for your page DC3? That way I can just copy-paste it and replace the contents of my page, and see if that works, lol. :)
dc3fanboy_nl
01-01-2007, 08:35 AM
Are the controler bar different than mine?:eek:
verry strange man. oke here is my source code:
<!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=iso-8859-1" />
<title>FLV Video</title>
</head>
<body bgcolor="#000000" style="margin:0px;"><center>
<object type="application/x-shockwave-flash" data="flowplayer.swf" width="640" height="480" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flowplayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" VALUE="#000000" />
<param name="flashvars" value="config={videoFile: '%2Fsoftware%2FVideo%2Fvideos%2F50+Cent+-+Candy+Shop+%28Feat.+Olivia%29.flv', initialScale: 'fit', loop: false}" />
</object>
</body>
</html>
I think it has nothing to do with source code, i hope somebody can help you with that MAC, please can somebody help evopanop for me. Somebody that has a MAC, please help him, I can't help him further, thanks in advance
evopanop
01-01-2007, 05:46 PM
Not that page's code, DC3. That looks to be the source code for the movie's specific page. I was asking to see your player.jsp's source code. Isn't player.jsp the file that you modified to be able to center the movie? Or do I have to modify the source code of the actual movie's page?
dc3fanboy_nl
01-01-2007, 06:08 PM
oh sorry :o , right that is the player.jsp
This is the code
<%@page import="redKawa.mediaCenter.video.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<!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=iso-8859-1" />
<title>FLV Video</title>
<%
String videoFile = (String) request.getAttribute("videoFile");
String flashvars = "config={videoFile: '" + URLEncoder.encode(request.getContextPath() + videoFile) + "'";
if (null == request.getAttribute("directoryError")) {
VideoSettings settings = (VideoSettings) request.getAttribute("settings");
String fullScreen = (String) settings.getFullscreen();
if ("off".equals(fullScreen)) {
flashvars = flashvars + ", initialScale: 'orig', loop: false}";
} else {
flashvars = flashvars + ", initialScale: 'fit', loop: false}";
}
%>
</head>
<body bgcolor="#CCCCCC" style="margin:0px;"><center>
<object type="application/x-shockwave-flash" data="flowplayer.swf" width="640" height="480" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flowplayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" VALUE="#CCCCCC" />
<param name="flashvars" value="<%=flashvars%>" />
</object>
<%
} else {%>
</head>
<body>
<h1>Video Not Found</h1>
<% } %>
</body>
</html>
Look where I have put the code <center>, to let the player play in centered
Edit: This file player.jsp is in my directory: C:\Program Files\Red Kawa\Media Center\software\Video\skins\Default. That you kno that.
evopanop
01-01-2007, 06:43 PM
Code didn't work... oh well. When I tried it, it just made the pages all White with nothing on them. I guess I can live with the movies being left-justified for now, until I can figure out a way to get them centered, lol. Thanks anyway for all the assistance, DC3 :)