Want to play video clips? Options
Reggie
Posted: Tuesday, April 24, 2007 5:25:05 PM
Rank: Devotee

Joined: 12/4/2006
Posts: 64
Can anybody help point me in the right direction? I want to to create a page in umbraco that contains an embeded media player that will allow a user to click on a link for a video clip and the clip will load into the player and play, has anybody got any ideas?
daniel
Posted: Tuesday, April 24, 2007 5:53:38 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
[/code]I've used a flash player to do this (since more people have flash than windows media player)

it looks like this http://en.900ttr.com/media-gallery/14-mile-at-some-place.aspx

what i've done is;
- I'm using this flash player: http://www.jeroenwijering.com/?item=Flash_Video_Player
- I'm uploading files to the site using a standard umbraco fileupload editorControl
- I've also written a httpHandler that stream the flv to the flashplayer so you get instand playback when the page loads. ;)


my template for the movie page looks like this:

Code:

<br style="clear: both;" />

<div id="player1" style="margin-left: 6px; margin-top: 20px;">
    <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
</div>


<script type="text/javascript">
    var FO = { movie:"/flvplayer.swf",width:"760",height:"420",majorversion:"8",build:"0",bgcolor:"#000000",
             flashvars:"file=<?UMBRACO_GETITEM field="movie"/>&showdigits=true&autostart=true&frontcolor=0xe5e3c0&lightcolor=0xffd22c&backcolor=0x000000&overstretch=true" };
    UFO.create(FO,"player1");
</script>

<br />



where movie is the alias of the fileUpload in umbraco
Code:

   <?UMBRACO_GETITEM field="movie"/>


You have to add this inside web.config for the streaming to work...
Code:

<system.web>

   .....

   <httpHandlers>
        <add verb="*" path="*.flv" type="FLVStreaming, FLVStreaming" />
    </httpHandlers>
</system.web>

and you can get the httpHandler here: http://en.900ttr.com/FLVStreaming.zip (unzip and drop the dll into the /bin folder)

you would also need the insert-flash-object-if-flash-is-supported-javascript-thingie here:
http://en.900ttr.com/js/ufo.js
daniel
Posted: Tuesday, April 24, 2007 5:57:47 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
forgot to say,

you also need to map .flv in IIS so asp.net handles that extention (for the flv streaming httpHandlder to work)
daniel
Posted: Tuesday, April 24, 2007 8:22:57 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
And a free piece of software to encode movies to .flv if you don't have macromedia flash installed. http://www.rivavx.com/?encoder
Reggie
Posted: Wednesday, April 25, 2007 10:46:56 AM
Rank: Devotee

Joined: 12/4/2006
Posts: 64
Excellent, thanks. Plenty for me to be going on with!
Reggie
Posted: Thursday, April 26, 2007 1:10:40 PM
Rank: Devotee

Joined: 12/4/2006
Posts: 64
OK, I have been playing with this and I am not quite getting what I need so I thought I would post where I have gotten up to. I noticed when I downloaded the FLV player that it is possible to submit a playlist to the player via an XML file which I think could do what I actually require but I have got stuck. This is the code that I have put into my template

Code:

<div id="player1" style="margin-left: 6px; margin-top: 20px;"> 
    This content requires the Adobe Flash Player. <a href=http://www.adobe.com/go/getflash/>Get Flash</a> to see this player.
</div> 

<br />

<script type="text/javascript" src="/media/js/swfobject.js" />

<div id="player">This text will be replaced</div>

<script type="text/javascript">
    var so = new SWFObject('/media/swf/flvplayer.swf','mpl','320','340','7');
    so.addParam('allowfullscreen','true');
    so.addVariable('displayheight','240');
    so.addVariable('file',/media/xml/playlist.xml');
    so.addVariable('height','340');
    so.addVariable('width','320');
    so.write('player');
</script>

<embed src="/media/swf/flvplayer.swf" width="400" height="400" allowfullscreen="false"/>

<br /> 


In my 'playlist.xml' file I have teh following XML

Code:

<playlist version="1" xmlns="http://xspf.org/ns/0/">
- <trackList>
- <track>
  <title>Afraid</title>
  <creator>Jeroen Wijering</creator>
  <location>video.flv</location>
  </track>
- <track>
  <title>Afraid (again)</title>
  <creator>Jeroen Wijering</creator>
  <location>video.flv</location>
  </track>
  </trackList>
  </playlist>


The file 'video.flv' is in the same directory.

I have gotten as far as the page trying to load a flash file but it just sits there with the little Adobe spiral spinning round in the centre of the screen with nothing else, any ideas what I am doing wrong?
daniel
Posted: Thursday, April 26, 2007 4:07:10 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 190
Location: Norway
try using links relative to the site root in playlist.xml - like; /media/xml/myVideo.svf
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.