Difference between revisions of "Shared Media wrapper"
m (→Wrappers) |
|||
(8 intermediate revisions by one other user not shown) | |||
Line 7: | Line 7: | ||
You might think, "Maybe I can just directly link to the Flash file?" | You might think, "Maybe I can just directly link to the Flash file?" | ||
Alas, Shared Media in its current implementation ''doesn't'' officially support direct-linking to FLV/SWF files. (When Torley tested this, it worked on Mac but not Windows.) | Alas, Shared Media in its current implementation ''doesn't'' officially support direct-linking to FLV/SWF files. (When [[Torley]] tested this, it worked on Mac but not Windows.) | ||
What you can do that achieves the same end result is '''use a ''wrapper'''''. | What you can do that achieves the same end result is '''use a ''wrapper'''''. | ||
Line 14: | Line 14: | ||
# Place the code you want within the wrapper. | # Place the code you want within the wrapper. | ||
# Convert the code into a '''[[data URI]]''', which is often the quickest way to show it inworld. Or if you'd prefer, insert the code into a webpage and upload it. | # Convert the code into a '''[[data URI|data: URI]]''', which is often the quickest way to show it inworld. Or if you'd prefer, insert the code into a webpage and upload it. | ||
== Wrappers == | == Wrappers == | ||
Line 20: | Line 20: | ||
Here's Torley's 1st pass at a wrapper. Surely it can be optimized and improved upon — if you've adapted it, add your version below! | Here's Torley's 1st pass at a wrapper. Surely it can be optimized and improved upon — if you've adapted it, add your version below! | ||
< | <html4strict> | ||
<html> | <html> | ||
<head> | <head> | ||
Line 37: | Line 37: | ||
</body> | </body> | ||
</html> | </html> | ||
</ | </html4strict> | ||
Replace the two instances of <code>http://torley.s3.amazonaws.com/panoramas/Here.swf</code> with your own URL. What this code does: | Replace the two instances of <code>http://torley.s3.amazonaws.com/panoramas/Here.swf</code> with your own URL. What this code does: | ||
Line 46: | Line 46: | ||
Depending on the source embed code, you may be able to completely replace the stuff between the <code><object></code> tags ''but'' make sure <code>width="100%"</code> and <code>height="100%"</code> stay the same if you want the content to fill the prim's face. | Depending on the source embed code, you may be able to completely replace the stuff between the <code><object></code> tags ''but'' make sure <code>width="100%"</code> and <code>height="100%"</code> stay the same if you want the content to fill the prim's face. | ||
Many sites have a "share" or "embed" button you can click, then copy the code over. For example, this is for the same Vimeo video used above, with <code>width</code> and <code>height</code> | Many sites have a "share" or "embed" button you can click, then copy the code over. For example, this is for the same Vimeo video used above, with the default <code>width="640"</code> and <code>height="480"</code> both changed to <code>100%</code>: | ||
< | <html4strict> | ||
<html> | <html> | ||
<head> | <head> | ||
Line 67: | Line 67: | ||
</body> | </body> | ||
</html> | </html> | ||
</ | </html4strict> | ||
The resulting data URI looks like this, which you can go ahead and paste into Shared Media for a prim's face: | The resulting data URI [http://tinyurl.com/ykgcama looks like this] (observe your browser's location bar), which you can go ahead and paste into Shared Media for a prim's face: | ||
[[File:Flash_video_wrapper.png|640px]] | |||
Experiment for yourself and see! | |||
{{KBcaution|Made a wrapper? Add it here and include helpful comments on its usage!}} | |||
<html4strict> | |||
<html> | |||
</html> | |||
</html4strict> | |||
== See also == | == See also == |
Latest revision as of 14:10, 24 March 2010
About
A situation that's becoming increasingly common: say you want to show a some content, like a Flash video, and only that content on a prim's face via Shared Media.
However, if you enter in a normal URL, like http://vimeo.com/9656041 , it shows everything on the page.
You might think, "Maybe I can just directly link to the Flash file?"
Alas, Shared Media in its current implementation doesn't officially support direct-linking to FLV/SWF files. (When Torley tested this, it worked on Mac but not Windows.)
What you can do that achieves the same end result is use a wrapper.
Basically:
- Place the code you want within the wrapper.
- Convert the code into a data: URI, which is often the quickest way to show it inworld. Or if you'd prefer, insert the code into a webpage and upload it.
Wrappers
Here's Torley's 1st pass at a wrapper. Surely it can be optimized and improved upon — if you've adapted it, add your version below!
<html4strict> <html>
<head> <title>Wrapper</title> </head> <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" style="overflow:hidden">
<object width="100%" height="100%"> <param name="movie" value="http://torley.s3.amazonaws.com/panoramas/Here.swf"> <embed src="http://torley.s3.amazonaws.com/panoramas/Here.swf" width="100%" height="100%" type="application/x-shockwave-flash"> </embed> </object>
</body>
</html> </html4strict>
Replace the two instances of http://torley.s3.amazonaws.com/panoramas/Here.swf
with your own URL. What this code does:
- Removes the white border that would be present by default around the edges of the Flash object.
- Centers the content on the prim. Not always required but there if you do need it, like if you're including additional text or embedding an object that fills the vertical but not the horizontal space.
Depending on the source embed code, you may be able to completely replace the stuff between the <object>
tags but make sure width="100%"
and height="100%"
stay the same if you want the content to fill the prim's face.
Many sites have a "share" or "embed" button you can click, then copy the code over. For example, this is for the same Vimeo video used above, with the default width="640"
and height="480"
both changed to 100%
:
<html4strict> <html>
<head> <title>Wrapper</title> </head> <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" style="overflow:hidden">
<object width="100%" height="100%"> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9656041&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=FF0080&fullscreen=1" /> <embed src="http://vimeo.com/moogaloop.swf?clip_id=9656041&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=FF0080&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%"> </embed> </object>
</body>
</html> </html4strict>
The resulting data URI looks like this (observe your browser's location bar), which you can go ahead and paste into Shared Media for a prim's face:
Experiment for yourself and see!
Important: Made a wrapper? Add it here and include helpful comments on its usage! |
<html4strict> <html>
</html> </html4strict>
See also
- Show YouTube on a full prim's face - YouTube, unlike some sites, has a built-in "show Flash movie on a full page" setup so you may not need the above.
- SWFObject 2 - Another way to wrap an object and display it full-face.