Changes between Initial Version and Version 1 of VirtualVideoClipUrlRewrite


Ignore:
Timestamp:
05/30/09 14:45:23 (14 years ago)
Author:
Arjen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VirtualVideoClipUrlRewrite

    v1 v1  
     1= Rewriting URLs for Virtual Video Clips =
     2
     3[wiki:Mod-H264-Streaming-Introduction-Version2 back][[PageOutline]]
     4
     5----
     6
     7== Virtual Video Clips ==
     8
     9We have a full length video available at the following URL 'http://www.example/com/video.mp4'. A preview can be provided by adding the 'vbegin' and 'vend' parameters, say for example we want to use 30 seconds of preview starting at the 15th second. We then have the following URL 'http://www.example.com/video.mp4?start=15&end=45'.
     10
     11This will work fine when using wget / curl, unfortunately a lot of Flash players don't behave correctly as they don't allow video URLS with query parameters in them. They just blindly append '?start=xyz' to the URL making it invalid.
     12
     13To work around this we can move the start and end parameters to the server side configuration. This has a couple of advantages:
     14
     15  - The user doesn't see the '?start=15&end=45' parameters any more.
     16  - Flash players assuming that they are adding the first query parameters work again.
     17
     18So, let's replace the preview URL 'http://www.example.com/video.mp4?start=15&end=45' by 'http://www.example.com/video.mp4/preview' and move the URL rewriting to the server side configuration.
     19
     20=== Apache ===
     21
     22In your .htaccess:
     23
     24{{{
     25RewriteEngine On
     26
     27# From: http://www.example.com/video.mp4/preview?start=xyz&foo=bar
     28# To: http://www.example.com/video.mp4?start=xyz&foo=bar&vbegin=15&vend=45
     29RewriteRule ^(.*)/preview\?(start=.*)$ $1?$2&vbegin=15&vend=45 [L]
     30}}}
     31
     32=== Lighttpd ===
     33
     34=== IIS ===
     35
     36=== Nginx ===