Smashed Video

kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Fri, 2007-05-04 09:06

I'm sure this is a quick fix but I cannot seem to find a solution anywhere. When I embed a flash video into my wordpress blog the video gets out of proportion. I've tried a bunch of things, I can't seem to find a place in a style sheet that would manage the flash player... Any tips would be greatly appreciated. Check out the webpage: www.iamkosta.org

Many many thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Fri, 2007-05-04 17:24

take a look at the divResize function you included.
the script tags are all messed up.
your WYSIWYG probably changed them a bit.
otherwise, looks great :)

-s
FlashYourWeb and Your Gallery

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Sat, 2007-05-05 11:14

Thank you so much for your quick response. I have had such a great experience with the forums.

You'll have to forgive me but I do not know what the divResize function is or where it resides. Is that part of a style sheet? And the script tags you are referring too, I haven't edited or modified anything in gallery. It's as standard as the way it was installed. I wish I knew more of how the player works, then maybe I could better understand what needs to be altered. The learning curve for these things... so steep.

Thank you so much for your help. It is greatly appreciated.

Regards,
Kosta

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Sat, 2007-05-05 11:32

I'm not familiar with how wordpress inserts gallery items into your stories, but it(wp's wysiwyg) changed the format which is messing with the finicky script tags.
yours looks like this:

<div class="one-image"><a href="http://www.iamkosta.org/blog/v/video/Balloon+Project+FINAL.flv.html"><br />
<script type="text/javascript">// <![CDATA[		function divResize(id, nw, nh) {			var obj = document.getElementById(id);			obj.style.width = nw + "px";			obj.style.height = nh + "px";		}		// ]]&gt;</script>
<div id="flashvideo" style="align:left;width:525px;height:292px">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"			 width="100%" height="100%" id="IFid1" class="ImageFrame_none">
<param name="movie" value="http://www.iamkosta.org/gallery/modules/flashvideo/lib/G2flv.swf"/>
<param name="FlashVars" value="flvUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F149-5%2FBalloon%2BProject%2BFINAL.flv&#038;Width=520&#038;Height=380&#038;title=Balloon+Project+FINAL&#038;allowDl=true&#038;thumbUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F150-6%2FBalloon%2BProject%2BFINAL.jpg&#038;langDownload=Download&#038;langLarge=Large&#038;langNormal=Normal"/>

<param name="quality" value="high"/>
<param name="scale" value="noscale"/>
<param name="salign" value="lt"/>
<param name="wmode" value="transparent"/>
<param name="allowScriptAccess" value="always"/><embed src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/G2flv.swf" flashvars="flvUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F149-5%2FBalloon%2BProject%2BFINAL.flv&#038;Width=520&#038;Height=380&#038;title=Balloon+Project+FINAL&#038;allowDl=true&#038;thumbUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F150-6%2FBalloon%2BProject%2BFINAL.jpg&#038;langDownload=Download&#038;langLarge=Large&#038;langNormal=Normal" type="application/x-shockwave-flash"			   width="100%" height="100%" quality="high" scale="noscale" salign="lt"			   wmode="transparent" allowScriptAccess="always"			   pluginspage="http://www.macromedia.com/go/getflashplayer"/><noembed></noembed></object>
</div>
<p></a></div>

(the bold parts are just unnecessary)
when it should look like(javascript needs to be properly formatted):

<div class="one-image">
<script type="text/javascript">
// <![CDATA[		
function divResize(id, nw, nh) {			
var obj = document.getElementById(id);			
obj.style.width = nw + "px";			
obj.style.height = nh + "px";		
}		
// ]]>
</script>
<div id="flashvideo" style="align:left;width:525px;height:292px">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"			 width="100%" height="100%" id="IFid1" class="ImageFrame_none">
<param name="movie" value="http://www.iamkosta.org/gallery/modules/flashvideo/lib/G2flv.swf"/>
<param name="FlashVars" value="flvUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F149-5%2FBalloon%2BProject%2BFINAL.flv&#038;Width=520&#038;Height=380&#038;title=Balloon+Project+FINAL&#038;allowDl=true&#038;thumbUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F150-6%2FBalloon%2BProject%2BFINAL.jpg&#038;langDownload=Download&#038;langLarge=Large&#038;langNormal=Normal"/>

<param name="quality" value="high"/>
<param name="scale" value="noscale"/>
<param name="salign" value="lt"/>
<param name="wmode" value="transparent"/>
<param name="allowScriptAccess" value="always"/><embed src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/G2flv.swf" flashvars="flvUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F149-5%2FBalloon%2BProject%2BFINAL.flv&#038;Width=520&#038;Height=380&#038;title=Balloon+Project+FINAL&#038;allowDl=true&#038;thumbUrl=http%3A%2F%2Fwww.iamkosta.org%2Fgallery%2Fd%2F150-6%2FBalloon%2BProject%2BFINAL.jpg&#038;langDownload=Download&#038;langLarge=Large&#038;langNormal=Normal" type="application/x-shockwave-flash"			   width="100%" height="100%" quality="high" scale="noscale" salign="lt"			   wmode="transparent" allowScriptAccess="always"			   pluginspage="http://www.macromedia.com/go/getflashplayer"/><noembed></noembed></object>
</div>
</div>

if you can edit your story, and correct the messy script tags, all should be fine.

-s
FlashYourWeb and Your Gallery

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Sat, 2007-05-05 11:47

ohhh boy. I don't know how to directly edit a story like that... I just use the embed feature that WPG2 lets me do. Man oh man... The webpage is dynamically created and I don't know where it actually gets that code so I can modify it...

My blog entry is literally formatted like this:

<wpg2>video/balloon project final.flv</wpg2>

3 Minutes of wonderful movie for the CSU Research Competition tommorow. Wish me luck.

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Sat, 2007-05-05 11:57

well... interestingly enough using that code to embed the video worked wonderfully. It's not exactly the solution I anticipated but it will work for now. If you find out a way to do it with wpg2 let me know!!

I swear you guys are genius'

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26091
Posted: Sat, 2007-05-05 16:18
kasmoie wrote:
My blog entry is literally formatted like this:
<wpg2>video/balloon project final.flv</wpg2>

kasmoie wrote:
If you find out a way to do it with wpg2 let me know!!

I don't think that WPG2 anticipated gallery items having javascript.
Can you post your query in the WPG2 forums and post a link to it here so I can follow. Perhaps the WPG2 devs will have a solution for the next release of WPG2. There is more WP experts there:
WPG2 2.x Plugin Help

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Sat, 2007-05-05 19:56

Absolutely, thanks for the help Dave. Here's a link:
http://www.galleryembedded.com/forums/viewtopic.php?t=7021&highlight=

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 10:57

Ok so it gets complicated now... According to the guys at WPG2 I needed to put some javascript in the header of my page, i did that, and it fixed everything.

So I decided to take it a step further and fix the double click problem that happens in internet exploder. I followed the instructions in the forum: http://gallery.menalto.com/node/61982

...and then the video was smashed again. I went ahead and re-copied the new javascript that had changed into the header and BAM it fixed the squished video. Then I went to check my site in IE, I got a fancy little error message in the place where the video was supposed to be:

Javascript required to view content.

I went ahead and checked my gallery, low and behold, all of the videos have the same problem.

Any insight on this one?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Tue, 2007-05-08 12:09

Sure, in your header between the <head></head> tags you can include the necessary javascript so it will always be there when needed.
ie.

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>IamKosta.org  </title>
<meta name="generator" content="WordPress 2.1.3" /> <!-- leave this for stats -->
<meta name="keywords" content="The Kosta Equivalent" />
<meta name="description" content="The Kosta Equivalent" />
<script type="text/javascript" src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/swfobject.js"></script>
<script type="text/javascript">	
    function divResize(id, nw, nh) {			
        var obj = document.getElementById(id);			
        obj.style.width = nw + "px";			
        obj.style.height = nh + "px";		
    }		
</script>
</head>

You would obviously have a lot more stuff in there. But just include our javascript there somewhere.
Then you could go ahead and remove it from gallery/modules/flashvideo/classes/FlashVideoRenderer.class.

This will not likely fix the fact that wp2 surrounds the flash object with a link
<a href="http://www.iamkosta.org/blog/v/video/Balloon+Project+FINAL.flv.html"></a>

-s
FlashYourWeb and Your Gallery

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 18:27

Any idea why I get the "Javascript required to view content" in IE? It's something that didn't happen until I added in your classes and libraries.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Tue, 2007-05-08 18:56
suprsidr wrote:
Then you could go ahead and remove it from gallery/modules/flashvideo/classes/FlashVideoRenderer.class.

replace your FlashVideoRenderer.class with this one.
FlashYourWeb and Your Gallery

AttachmentSize
FlashVideoRenderer.zip2.32 KB
 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 19:30

Replaced it, didn't make any change in IE and now it doesn't show up in firefox.

www.iamkosta.org

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Tue, 2007-05-08 20:09

Now you've got it twice in your header

<script type="text/javascript" src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/swfobject.js"></script>
<script type="text/javascript">	
    function divResize(id, nw, nh) {			
        var obj = document.getElementById(id);			
        obj.style.width = nw + "px";			
        obj.style.height = nh + "px";		
    }		
</script>


<div class="one-image">
<script type="text/javascript" src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/swfobject.js"></script>
<script type="text/javascript">// <![CDATA[
		function divResize(id, nw, nh) {
			var obj = document.getElementById(id);
			obj.style.width = nw + "px";
			obj.style.height = nh + "px";
		}
		// ]]&gt;</script>


Please get rid of the second one so it looks like this:

<script type="text/javascript" src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/swfobject.js"></script>
<script type="text/javascript">	
    function divResize(id, nw, nh) {			
        var obj = document.getElementById(id);			
        obj.style.width = nw + "px";			
        obj.style.height = nh + "px";		
    }		
</script>

-s

FlashYourWeb and Your Gallery

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 21:21

whoops! I was trying to figure out the difference between the two of them. I took it out but it is still not functional.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Tue, 2007-05-08 22:01

ok, where did the swf go?
http://www.iamkosta.org/gallery/modules/flashvideo/lib/G2flv.swf
is missing.

And

<script type="text/javascript" src="http://www.iamkosta.org/gallery/modules/flashvideo/lib/swfobject.js"></script>
<script type="text/javascript">	
    function divResize(id, nw, nh) {			
        var obj = document.getElementById(id);			
        obj.style.width = nw + "px";			
        obj.style.height = nh + "px";		
    }		
</script>

is missing from the head again.

-s
FlashYourWeb and Your Gallery

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 23:23

Ok got the G2flv.swf back where it's supposed to be, the stuff in the head hasn't left the head-- I'm a bit confused.

I hope this isn't too much to ask but could you possibly Instant message me so we could figure this out? I would really appreciated.

AIM Screename: Kasmoie

I made a donation today, you guys are great.

 
kasmoie

Joined: 2007-04-21
Posts: 20
Posted: Tue, 2007-05-08 23:42

I'm really sorry, I had to revert back to the old settings. My school just put out a press release that mentions my website and people were unhappy that the video wasn't working at all.

If you figure out a fix let me know, I'm forever grateful for your help.

-Kosta

www.iamkosta.org

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Wed, 2007-05-09 00:09

tried you on aim
AIM Screename: suprsidr
FlashYourWeb and Your Gallery

 
ryanmc

Joined: 2006-10-15
Posts: 72
Posted: Fri, 2008-06-27 18:12

Hey guys, I was able to follow these instructions to get videos embedded in my blog. Now I have run into another problem. I want to embed two movies on the same blog post. However, they are both trying to call devResize with the same div id. This obviously causes problems. Is there any way to tell one movie to use a different div id? I know I can change the id in the div, but how do I tell the movie what the new id is?

Thanks
Ryan

www.justechn.com

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Fri, 2008-06-27 21:20

htmlDiv=myDiv default is videoDiv
also make sure each player instance has its own id ;)

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
ryanmc

Joined: 2006-10-15
Posts: 72
Posted: Fri, 2008-06-27 21:36

Thank you for your quick reply. However I don't think I understand what you mean by htmlDiv=myDiv

Here is the javascript I have on the page.

<script type="text/javascript">
		// <![CDATA[
		function divResize(id, nw, nh) {
			var obj = document.getElementById(id);
			obj.style.width = nw + "px";
			obj.style.height = nh + "px";
		}
		// ]]>
		</script>

Here is my first movie. it uses the default id of flashvideo

		 <div id="flashvideo" style="align:left;width:525px;height:292px">
		 <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="IFid1" class="ImageFrame_none">
		    <param name="movie" value="http://www.justechn.com/gallery/modules/flashvideo/lib/G2flv.swf"/>
		    <param name="FlashVars" value="flvUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14580%26g2_serialNumber%3D5%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&Width=600&Height=400&title=Looj&allowDl=true&thumbUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14582%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&langDownload=Download&langLarge=Large&langNormal=Normal"/>
		    <param name="quality" value="high"/>
		    <param name="scale" value="noscale"/>
		    <param name="salign" value="lt"/>
		    <param name="wmode" value="transparent"/>
		    <param name="allowScriptAccess" value="always"/>
		    <embed src="http://www.justechn.com/gallery/modules/flashvideo/lib/G2flv.swf" flashvars="flvUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14580%26g2_serialNumber%3D5%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&Width=600&Height=400&title=Looj&allowDl=true&thumbUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14582%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&langDownload=Download&langLarge=Large&langNormal=Normal" type="application/x-shockwave-flash" width="100%" height="100%" quality="high" scale="noscale" salign="lt" wmode="transparent" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
		    <noembed><a href="http://www.justechn.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=14580&amp;g2_GALLERYSID=1fc0a638c66e5eeacd335c66b6766d32">Download movie</a></noembed>
		 </object></div>

Here is the second movie. I changed the id to flashvideo2


<div id="flashvideo2" style="align:left;width:525px;height:292px">
		 <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="IFid1" class="ImageFrame_none">
		    <param name="movie" value="http://www.justechn.com/gallery/modules/flashvideo/lib/G2flv.swf"/>
		    <param name="FlashVars" value="flvUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14583%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&Width=600&Height=400&title=Looj+slow&allowDl=true&thumbUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14585%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&langDownload=Download&langLarge=Large&langNormal=Normal"/>
		    <param name="quality" value="high"/>
		    <param name="scale" value="noscale"/>
		    <param name="salign" value="lt"/>
		    <param name="wmode" value="transparent"/>
		    <param name="allowScriptAccess" value="always"/>
		    <embed src="http://www.justechn.com/gallery/modules/flashvideo/lib/G2flv.swf" flashvars="flvUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14583%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&Width=600&Height=400&title=Looj+slow&allowDl=true&thumbUrl=http%3A%2F%2Fwww.justechn.com%2Fgallery%2Fmain.php%3Fg2_view%3Dcore.DownloadItem%26g2_itemId%3D14585%26g2_serialNumber%3D4%26g2_GALLERYSID%3D1fc0a638c66e5eeacd335c66b6766d32&langDownload=Download&langLarge=Large&langNormal=Normal" type="application/x-shockwave-flash" width="100%" height="100%" quality="high" scale="noscale" salign="lt" wmode="transparent" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
		    <noembed><a href="http://www.justechn.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=14583&amp;g2_GALLERYSID=1fc0a638c66e5eeacd335c66b6766d32">Download movie</a></noembed>
		 </object></div>

The problem I have now is that because I changed the second movie to flashvideo2 it does not grow to full size when I click the play button.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7933
Posted: Fri, 2008-06-27 22:15

the htmlDiv tells the swf which div to resize.
so you would add another flashvar:
flashvars="flvUrl=....&htmlDiv=flashvideo2

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2