Anthony Presley
asked this on November 10, 2009 12:05
I'm excited about the ability to embed video into ScreenSteps.
However, our video is hosted on our CDN, not on Youtube, Viddler, etc...
So, to actually embed the code into an HTML page, we might use this code:
<script src="/jw/embed/swfobject.js" type="text/javascript"></script>
<div id="video.flv">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this movie.
</div>
<script type="text/javascript">// <![CDATA[
var sd = new SWFObject('/jw/embed/player.swf','mpl','580','446','8');
sd.addParam('allowscriptaccess','always');
sd.addParam('allowfullscreen','true');
sd.addVariable('height','446');
sd.addVariable('width','580');
sd.addVariable('bufferlength','5');
sd.addVariable('image','http://url-to-image.jpg');
sd.addVariable('file','http://url-to-video.flv');
sd.write('video.flv');
// ]]>
</script>
This doesn't come close to working. In looking at the resulting code, ScreenSteps is stripping out the first div, but is leaving the items in the script tag enabled.
Any ideas?
Comments
It's probably bad kharma to answer myself, but in case anyone is stuck with this, the simple answer seems to be to go around the <script> tag completely, and simply use the <embed> tag.
IE:
<embed src="/jw/embed/player.swf" width="580" height="446" allowscriptaccess="always" allowfullscreen="true" flashvars="file=http://url-to-vide.flv&autostart=true&image=http://url-to-i...>
It would be nice, however, if we could insert javascript and have it work that way.
Any ideas?
I just copied and pasted your example into a new ScreenSteps step and exported the lesson to HTML using the Black BG template. In the resulting HTML file the javascript and DIVs came through unaltered. Can you describe the steps you are taking where you are seeing the DIV stripped?
I can try.
I added a step to the lesson, then added a graphic / image to the step.
Then, I right-clicked, went to add the movie code, and copied/pasted the code into the "HTML for Video" field.
Then, I exported it to a Blog post (Wordpress), and saved it as a draft.
When I go to the site, and click on "HTML" view of the web page, I'm missing the beginning <div>.
Basically, this code is missing:
<script src="/jw/embed/swfobject.js" type="text/javascript"></script>
<div id="video.flv">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this movie.
</div>
Which, since it needs the JS script to play the JS I loaded, that would be the issue.
I will try it again in a few minutes, and see if I can reproduce the issue on a file you can look at.
--
Anthony
Hmm, I just tried uploading a lesson to a WordPress blog and it worked out fine using your sample JS/HTML. If content is being removed it is probably WordPress.
If you can upload to a url that I can look at then I can help you troubleshoot. Alternatively you can email support with attached files.
embeding a video is also my problem because i am encountering different errors with it but when i start following this thread it help me a lot... thanks guys
Instead of this whole code
<embed src="/jw/embed/player.swf" width="580" height="446" allowscriptaccess="always" allowfullscreen="true" flashvars="file=http://url-to-vide.flv&autostart=true&image=http://url-to-i...>
you can try out some thing more simple like <object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object> set the height and width margins and place the exact and proper complete root of file.
The code didn't work for me.