Posts tagged Wordpress
I'm writing this post because a simple search on how to achieve CloudFront video streaming in wordpress using the jw media player plugin returns all kinds of results which are irrelevant if you just want to serve basic cloudfront streams!
So, here's how to do it (assuming you already know how to setup cloudfront to stream a video):
- Install the latest version of the JW Player Plugin (Plugins -> Add New -> Search for "JW Player Plugin for WordPress")
- Activate the plugin, you'll notice that a new menu called "JW Player" appears in your admin area
- Click on JW Player, you'll get a list of the players which currently exist (each player being a different customisation of the default JW Media Player)
- Click the copy button next to the out-of-the-box player to create a new player you can customise. Rember to give the new player a meaningful name instead of the default "out-of-the-box_copy". In my case I'm going to call this player "Test"
- Edit any of the player settings you like to create your new player (but don't click save - yet - if you do just click the edit button next to your new custom player to re-open the interface)
- Click the Advanced Settings tab of the player editor, scroll down the page until you see the streaming section and enter "rtmp" (without the quotes) in the provider box and the url to your clodfront streamer in the streamer box. e.g. if I setup a streaming distribution with the cname "videos.coderchris.com" my streamer url would be "rtmp://videos.coderchris.com:1935/cfx/st" that said you could just use the cloudfront default url for your distribution e.g. "hjh4887yh7h7.cloudfront.net" which would have the this streamer url: "rtmp://hjh4887yh7h7.cloudfront.net:1935/cfx/st"
- Now JW player knows where to stream your video files from you need to embed them in the page, which is best done using the jwplayer shorcode. So assuming I uploaded a video called "My Test File.mp4" to the S3 bucket feeding the cloudfront distribution and have set it's permissions to be public then I should be able to enter the following shortcode into a post or page "[jwplayer config="Test" file="My Test File.mp4"]" and that's it!
- In point 7 I left the spaces in the file name (didn't replace them with + or %20) because the player and/or the streamer handles the conversion to the right format
- This is the setup for basic CloudFront streaming. If you want to use private streaming with expiring urls to protect your content, there's a number of plugins out there you can use. I've done a quick review of the major ones and the best and lowest cost appears to be the Secure RTMP Streaming Video Plugin for WordPress from WordPress Academy - it's simple enough to deliver just this functionality.
- I've not looked at how you do this neatly with a html 5 backup yet, and I'm not sure if it's even possible. Standard progressive download streaming from S3 is possible out of the box with JW Player via use of the external media options in the media gallery and these options allow you to specify a html5 alternative there. For a good video on how to use these options visit http://askcharlyleetham.com/members-only/using-jw-player-wordpress-amazon-s3-youtube/login and if you want to protect the s3 content too visit http://askcharlyleetham.com/video/using-securedl-and-jwplayer-to-secure-your-amazon-videos/login to see how to do this with the securedl plugin
- For the basic JW Player shorcodes visit http://www.longtailvideo.com/support/addons/jw-player-plugin-for-wordpress/11913/jw-player-plugin-for-wordpress-shortcode-examples
Recently I have been doing a LOT of research into various wordpress themes and plugins and as you may expect the code varies from the excellent to the dire, but in most cases each achieves what it is supposed to.
That said however I have been seeing an increasing number of dodgy/spammy plugins which would probably cause more harm than good to the blogs of people who blindly install them.
These plugins or themes generally suggest they are doing one thing, but are actually doing another, such as building networks of spam links or sending valuable infomration to third parties... not good!
Though I could name and shame these dodgy items here I don't really wish to suffer the wrath of the scum of the internet, so all I'll offer is a plain and simple warning:
BE CAREFUL ABOUT THE PLUGINS YOU INSTALL AND THE THEMES YOU USE
Check them out, make sure they're fit for purpose, if you don't have enough knowledge yourself to understand what the plugin is doing ask someone who does.
Let's face it, at the worst you could expose yourself to having all important server details sent to a third-party and at the least you may end up with a blog covered in spam content getting you blocked by the major search engines.
A very simple example of a check anyone can perform is to look through the plugin/theme code and look for url's or email addresses that are not anything to do with you or the plugin/theme.
This simple check alone can help protect you against unwanted and potentially harmful disguised code.
I noticed today that my blog wasn't included in Google blog search, so I set out to find out why.
The reason was google didn't know about it, so I added it to my list of update notification services as this blogcarta post explains how to do: http://www.blogcarta.com/2006/10/17/how-to-ping-google-blog-search/
Oddly enough, though I know what pinging is, how it works, etc. I'd not really thought about/researched wordpress pinging to any great extent, and found out that I was missing a lot!
Firstly, I have a feed burner account (http://www.feedburner.com) and can automate a massive amount of the pinging from there so I turned all that on (see the PingShot option under the Publicize tab).
Secondly this got me thinking about what may be missed as feedburner wasn't pinging them, so I turned to the codex list of ping service (which oddly enough I had been to a number of times before but never used): http://codex.wordpress.org/Update_Services and I added all of these to my list too.
Next I saw the Smart Update Pinger on the codex and downloaded and installed that - It basically improves the pinging wordpress does by default by only pinging services when a new post is published and logging the responses.
And then I started looking at all the other posts that existed about pinging services and who should be pinged when and how. And as I'm tired my head started swimming.
So ultimately, what's needed here? Yes, you've guessed it, another improved plugin.
I shall be writing my own plugin to improve the pinging functionality in wordpress. It will be based on previous work, namely Smart Update Pinger but improve the existing functionality of that by including the following features:
- Central list of sites to ping automatically updated via webservice, so you're always on top of the game (would be so nice if this wasn't necessary, but hey ho!)
- Re-ping feature to notify ping services that are temporarily down about your post once they're back up
- Centralized logging to determine when a service goes off-line for extended periods of time or for good
All of the options will be turned on/off-able for users concerned about privacy.
If the guys who write Smart Update Pinger want to add this functionality in themselves, then fine, please go ahead but please let me know first. otherwise I'll be coding this up in a few days time.
If you want to be informed when the first release of my pinging plugin is made then either subscribe to my feed or leave me a comment
When I write plugins for wordpress I like to do it on a test blog in a live environment.
Maybe not the best idea, but it's how I like to do it, and it also flags up any weird and wonderful restrictions to the development of the plugin as a result of my hosting company's security policy.
For a while now I've worked with just the plain old plugin editor that comes with wordpress, but this is cumbersome to say the least and as such I went looking for a syntax highlighting editor which I could (if necessary) convert into a plugin to (ironically enough) improve the plugin editor.
Turns out that there's quite a few good syntax highlighting online code editors available (list at the end of this post) and at least one neat one (CodePress)Â has been converted to a wordpress plugin for theme editing and plugin editing.
This is a really great start, but there's a couple of things I'd really like to see to progress this work - If I have the time I'll do it myself, otherwise someone else reading this post may like to take it up!
Basically the current Codepress for wordpress plugin is missing (in my opinion) a few additional functions to create backups of the plugin or theme files you're working on, to an extent a rudimentary versioning system could and should be implemented within the editor.
There should be an option to package up the plugin you're editing and release it to the community/tie updates into the automatic plugin updater of 2.5
The current CodePress release is great but what would make it even greater would be code hinting when editing.
This would work (in my mind) by noticing the opening of ( and then checking what preceded it back to the last space or operator (*, ., /, etc.), then looking up this string from a function definition array and displaying a tooltip near where you are editing in the text area to remind you of the syntax - possibly with an autocomplete if you press enter.
I think the main problem with this is knowing where you are in the text area to display the div with the tool tip text in it in the right place. I know you can monitor where you are in a text area in terms of columns and rows, so surely if you know the location of the start of the text area and the size of the character in the text area and the co-ordinates of the cursor in the text area via row/column values you should be able to determine the optimal position for the <div>?
I think it would be really great to see that kind of functionality in any of the online code editors listed below on it's own let alone any other stuff such as versioning that I've already mentioned.
So there it is!
I probably will end up doing some work on the codepress plugin myself from a versioning point of view, but if any one else out there can figure out a way of doing the code hinting in JS that'd be fantastic!
Existing On line Code Editors:
Autosuggest example (could be used to provide the tool tip if the positioning is worked out): http://gadgetopia.com/post/3773
Recently I've been playing about with Twitter and so have some of the other guys at work.
Twitter's great butÂ but along with the blogs, facebook, myspace, MSN and whatever else there'd be sooo many places I'd have to update my status.
In reality, the only place I even half regularlyÂ keep my status updated is in my MSN IM client, soÂ I got to thinking, what if I could use MSN to update twitter and then use twitter to update my blogs (and possibly everything else - I haven't tried everything else yet though I have to admit).
Well after a short amount of time I found a very nice script for Messenger PluPlus! Live (http://www.msgpluslive.net/) called Twit4Live (http://www.msgpluslive.net/scripts/view/315-Twit4Live/)Â which allowed me to update twitter from MSN as I wanted to.
Then I found the Twitter Tag WordPress plugin for my blog (http://www.waltervos.com/downloads/wordpress-plugins/twitter-tag/), a winning combination - if only it worked...
To be fair, Twitter Tag will work on a large number of blogs, but because it has to do a remote file include (which a lot of shared hosting companies turn off for good reason), it didn't work on mine.
A short time later though I fixed this and everything's hunky dory (so long as you have Linux based hosting).
So if you want toÂ update your blogÂ with your twitter status and theÂ original Twitter Tag plugin doesn't work, why not giveÂ this modified version a try insteadÂ :)