See you next Friday.
Friday, November 25, 2011
Books I've Read This Week
Monday, November 21, 2011
Video Player Plugin for PhoneGap Android
One of the more annoying problems when using an Android WebView is that the <video/> tag is not well supported. In fact it is pretty much broken. To that end I spent some time writing a VideoPlayer plugin to help work around the issue. As of the weekend I put in a fix making playing YouTube videos easier so I figured I'd share it with all of you.
Installation of the plugin is pretty simple:
1. To install the plugin, move www/video.js to your project's www folder and include a reference to it in your html file after phonegap.{ver}.js.
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="video.js"></script>
2. Create a directory within your project called "src/com/phonegap/plugins/video" and copy "src/com/phonegap/plugins/video/VideoPlayer.java" into it.
3. In your res/xml/plugins.xml file add the following line:
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
Once installed you will be able to play a video by calling:
1. The file:// protocol to play something native to the device such as:
Sadly at this point in time the VideoPlayer does not support playing videos from your android asset directory. That is an enhancement for a later date.
So, there you go a pretty simple and easy to use plugin which can get you unstuck if you really need to play a video in your Android PhoneGap application. Lemme know you feedback.
Installation of the plugin is pretty simple:
1. To install the plugin, move www/video.js to your project's www folder and include a reference to it in your html file after phonegap.{ver}.js.
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="video.js"></script>
2. Create a directory within your project called "src/com/phonegap/plugins/video" and copy "src/com/phonegap/plugins/video/VideoPlayer.java" into it.
3. In your res/xml/plugins.xml file add the following line:
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
Once installed you will be able to play a video by calling:
window.plugins.videoPlayer.play(url);The url parameter can be one of three types:
1. The file:// protocol to play something native to the device such as:
window.plugins.videoPlayer.play("file:///sdcard/MyMovie.mp4");2. The http:// protocol to play something on the internet such as:window.plugins.videoPlayer.play("http://path.to.my/file.mp4");3. The http:// protocol pointing to a video on YouTube such as:window.plugins.videoPlayer.play("http://www.youtube.com/watch?v=E0UV5i5jY50");As long as your url has "youtube.com" and contains the video ID (i.e. the v parameter) the VideoPlayer should be able to start the YouTube app on your phone to play the video without any additional user interaction. However, if the phone does not have the YouTube app you are out of luck. In the future I may add a check for this that will ask the user to install the YouTube app first.Sadly at this point in time the VideoPlayer does not support playing videos from your android asset directory. That is an enhancement for a later date.
So, there you go a pretty simple and easy to use plugin which can get you unstuck if you really need to play a video in your Android PhoneGap application. Lemme know you feedback.
Friday, November 18, 2011
Books I've Read This Week
After two weeks of travel and attending conferences I came down with a case of con crud and I've been sick for a week. Consequently most of my reading time went to sleeping instead. Although I did get in some quick comic book hits.
See you next Friday.
See you next Friday.
Friday, November 11, 2011
Books I've Read This Week
The books have some really engaging characters and if you don't fall in love with the kids Alph and Vinnie then apparently you don't like smart mouth artful dodger types. |
See you next Friday.
Friday, November 4, 2011
Books I've Read This Week
See you next Friday.
Sunday, October 30, 2011
Books I've Read This Week
Whoops forgot to put this down as a schedule post.
Ghost in the Wires by Kevin Mitnick is his memoir of his time as the World's Most Wanted Hacker. While I must say that it is an entertaining book and I don't think there is any harm in Mr. Mitnick but I had a hard time feeling bad for some of the things he went through. Certainly when he started his hacking activities the actions he was taking were not illegal but they certainly were immoral. So while I feel he got a raw deal a lot of the time he brought it on himself. |
Fables Vol. 14: Witches to me is a return to form for Bill Willingham and the Fables universe. Volume 13 was the great Fables crossover with Jack of Fables. Now that, that debacle is behind us we once again get the story moving forward. The Fables have a new "adversary"in the form of Mr. Dark. In this volume we get to learn a lot more about Mr. Dark and the challenges that our favourite Fables are currently facing. All in all it's got me very excited about volume 15. |
See you next Friday for real this time.
The Matrix Has Given Up
Today I have irrefutable proof that we are actually living in a giant computer simulation. I'm in Denver, Colorado to give a workshop at the Interlab conference on Monday. When I landed at the airport I was walking down the concourse where I noticed a gentleman ordering a sandwich. I was pretty sure that it was the author J.C. Hutchins. Since I have no problem chatting people up I decided to ask the guy, "Hey are you J.C. Hutchins?" and of course it was.I spent about ten minutes chatting up the affable Mr. Hutchins before heading out to get my rental car. All the way to my hotel I was wondering what the odds of such a meeting would be. Since Dever is a city of approximately 2.5 million people I'll have to assume that it was a pretty slim chance.
Anyway, that's unlikely but it isn't really proof that we are all living in a simulation, that is until you factor in the next coincidence. I popped out of the hotel to grab a bite to eat and pick up a book for the plan rides home. Once I got to the counter I recognized the guy working the cash. I immediately said, "I know you!" to which started a bit of back and forth only to discover that he moved to Denver 7 years ago from Ottawa where he worked at the Pinecrest Chapters store. That's the book store of which I'm a life time member of their discount club since I shop their so damn much.
So one unlikely meeting is a co-incidence two means we are all figments of a computers imagination. An imagination which must be taxed as I keep meeting the same programs over and over again.
Subscribe to:
Posts (Atom)


