Putting SWF in wordpress posts

5 replies
  • WEB DESIGN
  • |
I want to post some swf videos on a site. Wprdpress will not store them in the media library. I tried a couple of plugins but they want to get them out of the media directory. I use godaddy for hosting and can put them in the file manager but can't link to them. so how can I get them into my post?
#posts #putting #swf #wordpress
  • Profile picture of the author Ron Killian
    I've always found SWF files to be a pain in the butt. Seems some times they work, some times they don't. Or it's just me. I dread using them.

    In the past, I have used a video plug-in, believe it was FLV-embed. Although it was made for FLV files, it played SWF files for me as well. And of course, with it, you can put in the url to the file, so it could be pretty much anywhere, no need for the media library (which is limited in file size).

    Only drawback, I don't know how secure that would be, if you don't want people getting to the actual files. Just a thought.
    Signature
    PLR Affiliate Program Has Launched! Easily Promote Over 5,000 PLR and MRR Products.

    Largest Selection of PLR Articles on the Planet! PLR Ebooks, PLR Video, PLR Websites and more with Private Label Rights
    {{ DiscussionBoard.errors[8986178].message }}
  • Profile picture of the author Nathan K
    Using shortcodes you can easily embed flash content into your post. Create a folder in your 'wpcontent/uploads' folder and name it 'swf' and upload all the swf into this folder.
    Paste the following code into your functions.php file.

    function shortcode_swfObj($atts, $content = null)
    {
    extract(shortcode_atts(array(
    "width" => 'auto',
    "height" => 'auto',
    "id" => ''
    ), $atts));

    $upload_dir = wp_upload_dir();
    $src = $upload_dir['baseurl'] . '/swf/'.$id.".swf";
    $output = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'.$width.'" height="'.$height.'" id="'.$id.'" align="middle">';
    $output .= '<param name="movie" value="'.$src.'"/>';
    $output .= '<!--[if !IE]>-->';
    $output .= '<object type="application/x-shockwave-flash" data="'.$src.'" width="'.$width.'" height="'.$height.'">
    <param name="movie" value="'.$src.'"/>';
    $output .= '<!--<![endif]-->';
    $output .= '<a href="http://www.adobe.com/go/getflash">';
    $output .= '<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/></a>';
    $output .= '<!--[if !IE]>--></object><!--<![endif]--></object>';
    return '<div class="swf">'.$output .'</div>';

    }
    add_shortcode('swf','shortcode_swfObj');

    Shortcode syntax
    --------------------
    [swf src="video"]
    or
    [swf src="video" height="100" width="200"]

    'video' is the file name without the extension. eg: 'video.swf'
    {{ DiscussionBoard.errors[8986378].message }}
  • Profile picture of the author Ron Killian
    That's interesting. I thought you needed a player so it plays in your page? Won't that code send the visitor kind of, away from the page, to a browser window to play the video?
    Signature
    PLR Affiliate Program Has Launched! Easily Promote Over 5,000 PLR and MRR Products.

    Largest Selection of PLR Articles on the Planet! PLR Ebooks, PLR Video, PLR Websites and more with Private Label Rights
    {{ DiscussionBoard.errors[8989241].message }}
  • Profile picture of the author Nathan K
    If you have the flash player installed it will run the swf, similar to flash banners you see on websites. You will need a player if you are going to play a flv file.
    {{ DiscussionBoard.errors[8989635].message }}
    • Profile picture of the author Brandon Tanner
      HTML5 video with Flash fallback is the way to go these days. If you use only Flash, then most mobile users will not be able to see your video at all.

      Most of the major video players (Flowplayer, JW Player, etc) support HTML5 video w/ Flash fallback, and also provide a WP plugin.
      Signature

      {{ DiscussionBoard.errors[8989706].message }}

Trending Topics