#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2006
    Posts
    18
    Rep Power
    0

    Preg_replace video embed


    been browsing google for the last hour, i'm looking for preg_replace to replace the video path in the following snippet.

    Code:
    <object id="FLVPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
    <param name="salign" value="lt" />
    <param name="quality" value="high" />
    <param name="scale" value="noscale" />
    <param name="FlashVars" value="&amp;MM_ComponentVersion=1&amp;skinName=http://www.dir.vc/demo/Clear_Skin_3&amp;streamName=http://www.dir.vc/demo/video12_trial_0sd.flv&amp;autoPlay=false&amp;autoRewind=false" />
    <param name="src" value="http://www.dir.vc/demo/FLVPlayer_Progressive.swf" />
    <param name="name" value="FLVPlayer" />
    <param name="flashvars" value="&amp;MM_ComponentVersion=1&amp;skinName=http://www.dir.vc/demo/Clear_Skin_3&amp;streamName=http://www.dir.vc/demo/video12_trial_0sd.flv&amp;autoPlay=false&amp;autoRewind=false" />
    <embed id="FLVPlayer" type="application/x-shockwave-flash" width="640" height="360" src="http://www.dir.vc/demo/FLVPlayer_Progressive.swf" name="FLVPlayer" flashvars="&amp;MM_ComponentVersion=1&amp;skinName=http://www.dir.vc/demo/Clear_Skin_3&amp;streamName=http://www.dir.vc/demo/video12_trial_0sd.flv&amp;autoPlay=false&amp;autoRewind=false" scale="noscale" quality="high" salign="lt"></embed></object>
    find all reference to the flv file, and change the folder to a specified folder.

    find: http://www.domain.com/demo/video12_trial_0sd.flv
    replace: http://www.domain.com/demo/full/video12-full-0sd.flv

    Please help me
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2006
    Posts
    18
    Rep Power
    0
    Code:
    $content = preg_replace('#/demo/(.*?)_trial_(.*?).flv#' , '/demo/full/$1_full_$2.flv'  , $content);
    n'mind, done !


IMN logo majestic logo threadwatch logo seochat tools logo