FlashComGuru Home Influxis ImediaseeUvault
                                                                                       Forum Index | Active Topics | Register
                                                                                                          List Overview | List Archives
                                                                                                                           About this site | Advertise
 

home

Adobe AIR (11)
Applications (41)
Books & Training (11)
Collaboration (18)
Components (11)
Events (87)
Flash Player (47)
Flex (41)
FMS (114)
General (128)
Hosting (6)
Jobs (17)
Off topic (43)
OSMF (5)
Press Releases (24)
Site Check (11)
Tools (56)
Videos & Players (74)

Follow me on Twitter

 
Here comes a little gotcha that could potentially have you pulling your hair out for a fair few hours, and some more once you realise how simple the 'fix' is.
If you are streaming files from FMS (be it version 2 or 3) then you may have made use of its Virtual Directory feature. This allows you to use a key (basically a named mapping) to point FMS at different storage locations for video files.

For example you could configure a key name of 'myvideos' and map this to a location of C:\myfiles\videostorage. The tag in vhost.xml would look like this:

</VirtualDirectory>
<Streams>myvideos;C:\myfiles\videostorage</Streams>
</VirtualDirectory>

Then every time a stream is requested via NetStream.play the server will look for the myvideos key in the stream path and if found locate the appropriate video file inside /videostorage (or if required in a subfolder).

The following code would play the file nicevid.flv located at C:\myfiles\videostorage\client1\nicevid.flv

ns.play("myvideos/client1/nicevid.flv");

So far so good.

So how would you use this approach with the FLVPlayback component? You may assume that you simply enter somthing such as the following as the video source property:
rtmp://myserver.com/myapp/videostorage/client1/nicevid.flv

For a non-mapped location this would probably work. The FLVPlayback component does not normally require you to pass an application instance name so you would not pass one here either (myapp in this case is the application name).

It turns out though that if you use mapping you need to explicitly pass an application instance name, otherwise the FLVPlayback component will utilize myvideos as the instance and lose the mapping. Therefore the correct rtmp string in this case would be
rtmp://myserver.com/myapp/myinstance/myvideos/client1/nicevid.flv

Note that you can substitute myinstance for any name you see fit, it doesn't matter what you pass as long as you pass *something* here. So let's look at the elements of this rtmp string quickly:

rtmp://myserver.com - the server address
myapp - the application name
myinstance - the application instance name
myvideos - the named mapping which directs stream requests to the virtual directory we configured
client1 - a subfolder which holds videos
nicevid.flv - the actual video we want to play

Hopefully this helps somebody sometime.

Comments
[Add Comment]
Thank you, the "myinstance" part was causing me problems for days. The VideoPlayer class load command does not need this, but the flvPlayback component does.
# Posted By Brian Kalbfleisch | 5/13/08 6:50 PM
to play an mp4 file the rtmp string would be:
rtmp://myserver.com/myapp/myinstance/mp4:videostorage/client1/nicevid.mp4
# Posted By Jorge Tejada | 5/19/08 8:11 PM
Is there some specific reason why I can't get my FLV to play through the FLVPlayback component when I've got a user subfolder?

ex:
rtmp://myserver.com/myapp/userid/video.flv

It plays fine when there's no subfolder:
rtmp://myserver.com/myapp/video.flv

What gives?
# Posted By devincolumbus | 5/30/08 7:23 PM
shot in the dark but try this:

rtmp://myserver.com/myapp/instance/userid/video.flv

Does that work?
# Posted By Stefan Richter | 5/30/08 10:51 PM
OHHH EMMM GEEEEE.

days of frustration. fixed.
# Posted By Dzejms | 6/18/08 3:37 PM
glad to hear it :-)
# Posted By Stefan Richter | 6/18/08 3:43 PM
I believe there is a mistake in the text, the correct rtmp string probably should be rtmp://myserver.com/myapp/myinstance/myvideos/client1/nicevid.flv
If not, why?
# Posted By SiViG | 7/25/08 5:15 PM
you are right, my bad. Fixed now. Thank you.
# Posted By stefan richter | 7/25/08 8:43 PM
Where download this commponents free ?
# Posted By xdynx | 8/6/08 8:01 AM
Thanks a lot Stefan.
Just curious, how did you figure out the instance part? Is it documented by adobe somewhere?
# Posted By Dr. Bence | 11/5/08 5:01 AM
hi,
I don't believe it's documented, I figured it out myself.
# Posted By Stefan Richter | 11/5/08 8:39 AM
</VirtualDirectory>
<Streams>myvideos;C:\myfiles\videostorage</Streams>
</VirtualDirectory>

above in the "streams" tag , can i point out to the remote location where my videos are present , if so how can i pass ? is it through http or ftp .

please do reply any one .

thank you .
# Posted By lakshmikanth reddy | 11/17/08 10:18 AM
hi there,
no you cannot point this to a HTTP address. Maybe future versions of FMS will allow this feature.
# Posted By Stefan Richter | 11/17/08 10:29 AM
Hello everybody,
I've got a video located at :
C:\Program Files\Adobe\Flash Media Server 3.5\applications\studio\streams\_definst_\livestream.flv

and I can't manage to play it through an FLVPlayback component.
I used the rtmp string rtmp://192.19.105.39/testStudio/_definst_/livestream
What sould I do more ?

Thanx in advance.
# Posted By Gaston Fournier | 7/22/09 8:51 AM
Looks like you are using the wrong application name.
Your app name seems to be studio since your folder name is studio: C:\Program Files\Adobe\Flash Media Server 3.5\applications\studio..

yet you are trying to connect to testStudio:
rtmp://192.19.105.39/testStudio
# Posted By Stefan Richter | 7/22/09 10:45 AM
Sorry Stefan, I missed my copy/paste.
My stream is recorded in C:\Program Files\Adobe\Flash Media Server 3.5\applications\testStudio\streams\_definst_\livestream.flv
and I'm trying to connect to rtmp://192.19.105.39/testStudio/_definst_/livestream but nothing happens.

I've also tried to drag directly into my scene an FLVPlayback component with the source property sets to rtmp://192.19.105.39/testStudio/_definst_/livestream but the result is still the same.

Maybe it is a XML configuration problem because I can display files located in C:\Program Files\Adobe\Flash Media Server 3.5\applications\vod\media perfectly.

Thank you for your response.
# Posted By Gaston Fournier | 7/22/09 1:10 PM
did you deploy the main.asc file that's required for the FLVPlayback component to work?
# Posted By Stefan Richter | 7/22/09 1:48 PM
Yes but I've discovered that we're using Flash Media Streaming Server and not Flash Media Interactive Server so I think I can't use such custom .asc files.
Thanks for your time Stefan.
# Posted By Gaston Fournier | 7/22/09 2:30 PM
yeah that's correct, in fact - as far as I know - you can't even use custom apps either. So you should try streaming your files through the vod app instead. It should support the FLVPlayback component

Cheers

Stefan
# Posted By Stefan Richter | 7/22/09 2:32 PM
Hi, I want to play(streaming)a video from Flash Media Server 2 using FLVplayback component(Flash 8)but can not. Connection is established but video is not showing. Please help to do it.
# Posted By Nisith | 9/11/09 6:09 AM