SWFPut is a video plugin for WordPress that can be used in posts and pages and the widget areas (sidebar, etc.).

For Example

The first sample is a small clip of Sita Sings the Blues, a public domain work. The clip is served from this host, but the whole feature length animation is available at Archive.org. There are several formats available there, including a prepared DVD Video filesystem ready to burn on a single layer blank.

Sita Sings the Blues (2008) one minute clip

The clip here was encoded at a low bitrate to reduce data transfer, and some compression artifacts are visible. Be assured that those artifacts are not present in the original available at Archive.org. Video to be displayed with SWFPut doesn’t need to be hosted on the same machine as the WordPress site. You can use an off-site URL (provided, of course, that it is your privilege to link to the material).

Duffy the Mascot at Archive.org

The second sample is a short stop-animation film served from Archive.org. The animation is done very well, and the film is amusing. And cute too. Watch the detail.

Watch a couple more examples from Archive,org, or a few from WordPress.tv. There are a few special use examples, too.

Details

SWFPut provides WordPress articles and pages with a responsive player for HTML5 and Flash video types. Video files may be selected from the WordPress media library, or any suitable URL may be used. SWFPut does not embed video players from sites such as YouTube or Vimeo. Video URLs may point to other sites, like the Archive.org example on this page.

SWFPut uses JavaScript to make the video presentation responsive, changing size suitably for various device screens, or browser window size changes.

SWFPut markup is designed to fall back usefully when a visitor has JavaScript disabled. Without scripting, the HTML video element or the object element (for Flash) should be present in correct form.

SWFPut sets video in a page using some of the same CSS classes that WordPress uses for images, so that your theme’s presentation of images should apply to SWFPut video (including align left, center, right, and none settings).

As of version 2.9 SWFPut video setup is done with a simple graphical interface if the WordPress version is 4.0 or greater, using new core code. In older versions a metabox form is used, and this form is retained along with the new interface to serve as an advanced form, as it provides additional settings such as video aspect ratio, initial volume, and control bar height.

SWFPut also provides a video widget for any widget areas your theme might provide. SWFPut widget setup is done with a version of the advanced form. Widget samples can be seen in the footer area at the bottom of this page.

Comments and Support

Please leave comments or support requests at the WordPress.org support forum, or as a comment on this page.

12 thoughts on “SWFPut

  1. Hi!
    When I publish a FLV-movie the movie is just black when I run it from the website. When I run it from the computer it looks as it should do.

    [putswf_video url="http://goldwing.ddns.me/wp-content/uploads/2014/12/anim01.flv" width="360" height="360" align="center" preload="image"][/putswf_video]

    What is wrong?

    Best regards,
    /Thomas Andersson

    1. Hi,

      I checked the .flv from your link. It is unusual: it has only 8 11 frames, and also uses the sorenson codec (the h264 codec is common in newer flv files).

      I confirmed that your .flv does not play, but after conversion to .flv with the h264 codec it is fine. This is most likely caused by the Adobe flash plugin itself; in any case, I cannot think of anything in my video player flash program that would behave differently depending on the codec used in an .flv file.

      Moreover, conversion to .mp4 format is fine, and this has the advantage of making the HTML5 video player available. That’s good because the Adobe flash plugin has fallen out of favor on some platforms.

      So the easiest solution is to convert the file to modern .flv with h264 codec, or preferably .mp4. And if you have video conversion software handy, I would also suggest providing .ogv and .webm types as well.

      UPDATE: I had suggested an .ogv type, but I find the software I use (ffmpeg) does not make a working .ogv video. The small number of frames is probably a problem for some codecs. Conversions to .mp4, .webm, and h264/.flv do work.

      – Ed

  2. Thanks for the plugin, I’m using to replace flvplayer. I’ve tried to insert an flv that’s loaded via filemanager as wordpress seems to be blcoking the load of flv. Anyway, the file is created from screenflow on a mac and then saved as an flv. I can see the file from various of the plug in drop downs, but never managed to get it to play. I found the code from this page and I can now get the file to play, but everytime I set loop and autoload options they have no effect and the settings disappear each time I reload the page in edit mode – see http://www.christchurchtonbridge.com/powerpoint2 – Looking at a couple of pages I wondered if mp4 files would autoplay better, so I then exported it as an mp4 and tried again. This time I could upload the media using standard wordpress and the file would play. http://www.christchurchtonbridge.com/powerpoint . However, I still can’t get it to loop or autoload. What am I doing wrong? Any advice greatfully recieved.

    1. I’ll be glad to help if I can. I’ll address your points, but out the of order they were stated in.

      • “[…] everytime I set loop and autoload options they have no effect and the settings disappear each time I reload the page […]”
        To edit an SWFPut video after it has been inserted, click the button “Fill from post”. If there is more than one video then repeated clicks will cycle throught all. When the video you want to change is current in the SWFPut form (evident from the form fields), make any changes (such as loop and autoload) and then click the “Replace current in post” button (that button places the modified data in the editor, and without it changes are lost). Also, be sure to click the “Update” button in the Publish metabox to send the changes back to the WordPress database.
      • “[…] an flv that’s loaded via filemanager as wordpress seems to be blcoking the load of flv.” I’m not sure I understand, but it might be the limit on the size of file uploads. Upload size limits are imposed by both PHP (the language) and WordPress. Adjusting the limit is complicated, and might require permission and help from your site hosting provider, but an alternative is to upload large video files with ssh (Secure Shell) or ftp. Place the files under the the wp-content/uploads directory (or preferably a subdirectory under wp-content/uploads) and the files should be available from the SWFPut form, provided they have a suffix associated with a supported video format (.flv, .mp4, .ogg, .ogv, .webm).
      • Regarding .mp4: “This time I could upload the media using standard wordpress and the file would play.” Maybe the file was just slightly smaller than the .flv; enough to fit under the limit. In any case, .mp4 is preferable for a number of reasons. The best practice, if you have the means, is to provide the video in conversions to all supported formats. That will be the most reliable among the several web browsers and the various platforms they run on.

      Note that when you are on the post/page editor page, at the top right corner there is a “Help” button. That will drop down a help text area with tabs for topics on the left. There is a tab for SWFPut, and the discussion there might be helpful.

      Feel free to ask more questions.

  3. Having posted the question, I managed to track down part of the answer – at least for wmv and mp4 files. The “text” in wordpress should be something like this [video width="1040" height="720" wmv="http://mywebsite.com/wp-content/uploads/myfile.wmv" autoplay="y" loop="on"][/video] – hope that helps someone else.

    1. Well, using [video][/video] is not using SWFPut; that will use the video player included with WordPress. That might or might not be suitable. I have not checked with the latest WordPress version 4.1, but in previous versions the default video player did not handle size very well on small devices or simply small browser window sizes.

      SWFPut uses JavaScript to adjust the displayed size according to available space and the surrounding page elements. After much testing, I believe it adjusts well to various screens, and handles interactive window resizing well too.

      In any case, you certainly want to avoid the .wmv video format, unless you only want users of Microsoft Windows to see your videos — and even then probably only those using Internet Explorer. Regardless of whether you use SWFPut or the WordPress default video player, your best single choice for a video format (presently) is probably .mp4 if you want the best chance that the video will work for most of your site visitors using any browser or platform.

  4. Hi, I’m hoping to find a plugin I can use to display flash ads on my WordPress site. I installed the SWFPut plugin and placed my flash ad in a sidebar widget. I thought I had the URL linked properly but when I saved the widget and viewed it in a browser I got this message: Warning: Illegal string offset ‘el’ in /home/content/p3pnexwpnas06_data03/25/2310925/html/wp-content/plugins/swfput/swfput.php on line 1925
    <

    Can you please help me to make this work? I am not sure where it went wrong. I will appreciate your advise. Thank you.

    1. Thank you for contacting me about this. There should be a better error message.

      What has happened is the plugin (SWFPut) rejected the URL that was placed in the “Url or media library ID for flash video:” field of the form (or the “URLs for HTML5 video (.mp4, .webm, .ogv):” field).

      SWFPut does fairly strict checking on the URL. For example, the path part of the URL may not have a “/../” (the double dots mean parent directory). This checking is meant to make SWFPut secure and prevent things like accidentally exposing data on the server.

      Can you please post the URL that you gave to SWFPut? If the URL has anything that should be kept private then changes names, but not the form of the URL.

      -Ed

  5. Hi Ed,

    Thank you for your response. This is the URL I placed in the widget: ftp://(user@host:redacted)/public_html/McDuffieFlashAd.swf

    I copied it from the control panel of the website server. It is the same URL that was uploaded into my Filezilla account when I transferred the flash animation from my desktop.

    I am attempting to display flash ads in my WordPress sidebar widgets. (This is for a newspaper website.)

    I will be very grateful if you can instruct me on the proper method of doing so.

    1. Hi Cheryl,

      First, sorry for the delay responding: for some reason this WP site did not send me an email notification of your last post.

      Well, the first problem with the URL is the FTP protocol (the “ftp://” part). Neither the flash plugin or HTML5 video will use ftp. You need to use HTTP (“http://” or secure http “https://“) for either of those (and most other things too).

      You can try simply replacing ftp with http; it might work, but that will be hit or miss. If not, you should download the .FLV file with a ftp program, and then upload it to your site. You might not be able to upload your video with the WordPress media upload feature, because video files are often larger than an upload size limit that can only be changed by an admintrator controlling PHP on the web server. (Sigh, if only it were easy!)

      You might need to upload the video to your site with an ftp or ssh program. Either way, it should be placed somewhere under the WordPress wp-content/uploads directory.

      But first just try changing ftp to http. And let me know how it works out.

      -Ed

  6. Hello again Ed,

    Thanks for your response. WP didn’t send me an email for your first response either, so I’ve have had this window open on my computer all day, waiting with baited breath. (Perhaps I should swish some mouth wash… LOL) Thanks for getting back to me. I tried my other flash ad in the SWFPut widget with the http prefix: (http://(redacted)/public_html/LacyWest.swf) then checked my update in a fresh browser, but alas, got this error message: Warning: Illegal string offset ‘el’ in /home/content/p3pnexwpnas06_data03/25/2310925/html/wp-content/plugins/swfput/swfput.php on line 1925
    <

    I really want to make this plugin work because I think the ad will look it's best as a swf file.

    I tried converting the first ad to a MP4 and uploaded it to YouTube so I could put in WP in another player but I'm stuck with a playbar that way and I don't want that.

    I'm using the WP Point theme and this SWFPut plugin has already been tested in that theme, so I'm guessing the problem is in my URL.

    I placed the swf file in my Filezilla account and also in the servers cPanel but the url I got that way was the one with the ftp prefix. I'd be really grateful if you can school me as to how to get an external URL that will work or an internal URL that will work.

    I'm not all that used to WP yet and I have a lot to learn about everything. Please, have mercy. Thanks in advance.

    1. Hi Cheryl,

      The .swf URL won’t work because .swf is something different, not video (actually, its a special program for the flash browser plugin to run, and SWFPut includes its own).

      You’ve converted the .flv to .mp4? Good! That’s better for several reasons, not least of which is that both HTML5 video and a flash video player can use .mp4. SWFPut includes an HTML5 player with the same appearance and behavior as its flash player, and by default arranges that HTML5 will be used where supported, but old browsers may fall back to flash. OTOH, HTML5 does not support .flv type video, so if you use that file you’re stuck with flash only.

      So, the thing to do is get the .mp4 file (or both) uploaded to your site. First, save the file on your computer (the one you’re using to login to your WordPress site). Try uploading with WordPress itself (even though I mentioned a size limit previously, it’s worth a try). Log in to WordPress, and on the left-side menu, select “Media” and then on the new page click “Add New.” That loads a page with an area to ‘drag and drop’ files, or an alternative “Select Files” button that will show a file open dialog. Either way, give it a try.

      If you get an error about a file size limit, you’ll need to upload directly to your site. This is where I can’t help very much, because I’m not familiar with your site host. I’m also not familiar with filezilla, but I see it’s an FTP program, so it should work if your site host allows FTP uploads. (If your site allows SSH uploads, there are free programs for that too, e.g., for MS Windows there is “PuTTY”). However you upload the file, it should be placed under the ‘wp-content/uploads‘ directory. Once the video file is there, you should be able to select it from the drop-down lists on the SWFPut forms (just under the URL entry fields).

      BTW, I just looked at the filezilla tutorial (https://wiki.filezilla-project.org/FileZilla_Client_Tutorial_%28en%29) and it looks like it should help you find the ‘wp-content/uploads‘ directory that you should upload to.

      > I’m not all that used to WP yet and I have a lot to learn about everything. Please, have mercy. Thanks in advance.

      No problem!

      -Ed

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>