Archive for April, 2010

Setting up Flowplayer with Amazon Cloudfront and Token access

Wednesday, April 21st, 2010

Amazon has added token based access to the cloudfront rtmp servers here: http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?PrivateContent.html

This means you can put some control around who accesses your content.

Here is one way to set up flowplayer to use this:

<script type="text/javascript" src="http://static.flowplayer.org/js/flowplayer-3.1.4.min.js"></script>
<div class="player" id="id_flowplayer" style="width:640px;height:320px;">
</div>
<script language='javascript'>
flowplayer("id_flowplayer", "http://releases.flowplayer.org/swf/flowplayer-3.1.5.swf", {
 log: { level:"debug",filter:'org.flowplayer.rtmp.*' },
 clip: {
   autoPlay:false,
   // This is the path to the video file
   url: encodeURIComponent('flv:test.mp4?Expires=1258237200&Signature=TBD&Key-Pair-Id=PK123456789754'),
   provider: 'aws'
 },
 // streaming plugins are configured under the plugins node
 plugins: {
   // here is our rtmp plugin configuration, configured for AWS
   aws: {
      url: 'http://releases.flowplayer.org/swf/flowplayer.rtmp-3.1.3.swf',
      // netConnectionUrl defines where the streams are found
      netConnectionUrl: 'rtmp://your aws hostname.cloudfront.net/cfx/st'
   }
 }
});
</script>

Android maps tip – tap on an address in gmail to open maps

Saturday, April 10th, 2010

Here’s an interesting maps tip – when someone emails you an address, like 825 Walnut Street, Philadelphia, PA 19107-5195 (Walnut Street Theater) you can tap the address part in the gmail app and it will automatically open the google map application to that address.

Very handy, as it doesn’t underline the address like a link, so you don’t know you can tap the address unless you know the tip.

Does html5 video work in Android?

Wednesday, April 7th, 2010

In the interest of finding the right answer by posting (possibly) incorrect information, here goes.

Transcode an H.264 video to something that works great on the ipad/iphone: video: avc1, 29.97 fps, 380 kbps, 480 x 370 Audio: mp4a, 44 kHz, 64 kbps

Put together a page and view it on the iphone/ipad:


<!DOCTYPE html>
<html><head><title>html5 test</title></head><body>
<video id="movie" width="480" height="370" poster="http://example.com/still.jpg" controls>
<source src="http://example.com/video.mp4" type="video/mp4">
Your browser does not support html5 video.
</video>
</body></html>

View it on the iphone/ipad – wonderful html5 video plays.

View it on Android 1.6 (G1) – Nope, get “Your browser does not support html5 video”.
View it on Android 2.1 (Nexus One) – See the poster image, and if you add the onclick hack below the video will play in the media player.
View it on Android 2.2 (Nexus One) – See the poster image, but clicking the poster does nothing, cannot view video.

When will Android support html5 video?

Update:
Found a message from Dan Morrill html5 video is not supported at this time in the browser.

Update 2:
Some people have found some level of success by adding onclick="this.play();" to the <video> tag, but this doesn’t always work, for instance it used to work with Android 2.1 on the Nexus One, but since upgrading to Android 2.2 it no longer works.

postMessage doesn’t work in IE if you mix http and https

Tuesday, April 6th, 2010

What’s the point of implementing postMessage if you can’t communicate across http and https versions of your page?

http://msdn.microsoft.com/en-us/library/cc197015%28VS.85%29.aspx