I am currently working on an application to distribute movies across the organisation. Something similar as OpenTV on OpenNTF, but then 99% based upon XPages technology.
The movies I have are curently all in FLV (Flash Video) format which is fine for me.
I have taken a look at HTML5 and video, but we still have many Internet Explorer 7 installations which does not seem to run with HTML5 media Libraries that contain fallback scenarios
Therefor I believe I am stucked for now with an Flash Video based solution.
Since I have no experience at this point with integrating Flash in XPages I wonder if you have any recommendations or sample code?
OpenTV seems to be using a JS Library called Swfobject which seems to do the job just fine…
You can easily do it with SWF files
http://www.seancull.co.uk/Public/seancull.nsf/dx/adding-video-to-the-domino-blog-template.htm?opendocument&comments#anc1
Hi Patrick,
I have quite some experience with embedding video in web applications. I have been using an open source product called “JW Player” to do so and can highly recommend it.
If I’m not mistaken that player also uses the SWFObject library to create the actual objects.
Hi Mark, I have taken a look at JW Player which seems promosing, also the setup wizard is of great help. Thanks!
This is how I solved the problem via JW Player:
<div id=”preview”>
The player will show soon in this section…
</div>
<xp:scriptBlock id=”scriptBlock1″ type=”text/javascript”
src=”../swfobject.js” />
<xp:scriptBlock id=”scriptBlock2″>
<xp:this.value><![CDATA[thumb = “#{javascript:var doc:NotesDocument = movie;var thumb = doc.getItemValueString(“Tx_DspMovieThumb”);return thumb;}”;
movie = “#{javascript:var doc:NotesDocument = movie;var moviefile = doc.getItemValueString(“Tx_DspMovie”);return moviefile;}”;
ref=”#{javascript:var doc:NotesDocument = movie.getDocument();return doc.getUniversalID();}”;
ref += “/$FILE/”;
var so = new SWFObject(‘../player.swf’,’ply’,’470′,’320′,’9′,’#000000′);
so.addParam(‘allowfullscreen’,’true’);
so.addParam(‘allowscriptaccess’,’always’);
so.addParam(‘wmode’,’opaque’);
so.addVariable(‘image’,thumb);
so.addVariable(‘file’,ref + movie);
so.addVariable(‘controlbar’,’over’);
so.addVariable(‘autostart’,’true’);
so.addVariable(‘bufferlength’,’20’);
so.addVariable(‘fullscreen’,’true’);
so.addVariable(‘stretching’,’fill’);
so.write(‘preview’);]]></xp:this.value>
</xp:scriptBlock>
For the thumb and moviefile values I have computed fields in the Notes form.
Thumb:
var_AttachNames := @LowerCase(@AttachmentNames);
var_Extension := @Right( var_AttachNames ; “.” );
var_JPGPosition := @Member(“jpg”;var_Extension);
var_JPEGPosition := @Member(“jpeg”;var_Extension);
var_GIFPosition := @Member(“gif”;var_Extension);
@If(
var_JPGPosition != 0;
var_AttachNames[var_JPGPosition];
@If(
var_JPEGPosition != 0;
var_AttachNames[var_JPEGPosition];
@If(
var_GIFPosition != 0;
var_AttachNames[var_GIFPosition];
“”)))
Moviefile:
var_AttachNames := @LowerCase(@AttachmentNames);
var_Extension := @Right( var_AttachNames ; “.” );
var_FLVPosition := @Member(“flv”;var_Extension);
var_SWFPosition := @Member(“swf”;var_Extension);
@If(
var_FLVPosition != 0;
@URLEncode(“UTF-8”;var_AttachNames[var_FLVPosition]);
@If(
var_SWFPosition != 0;
@URLEncode(“UTF-8”;var_AttachNames[var_SWFPosition]);
“”))
Works like a charm !
Indeed, great stuff. Did you get the yt.swf running? I added the code from the wizzard and the player and the RSS feed displays, but I always get an error 2035 when I try to play the video. yt.swf is in the same folder as player. I imported the files to the file section of my application.
I must go back and do another version of openTV, I never got around to cleaning up the code, and adding a whole bunch of new sexy features.
JWplayer is very good, and very simple to use…
Hej Neil,
I guess maintaining the same app with XPages is much easier.
yt.swf works, when i put the file on the server. But I always get an #2035 error, when I import the file as file resource
I am not using that feature, since it is connected to movies on YouTube?