Wednesday, October 22, 2008
ooTunes, internet radio, last.fm, and airtunes
Tuesday, October 21, 2008
Some bugs fixed...
Create Genius Playlists in iTunes on the go using ooTunes ... thank you Applescript
- This is currently only working in a regular browser (not on the iPhone yet).
- This only works on Mac's (sorry PC, you've had a rough couple of years, I know).
- This only works on Mac's when you turn on "User interface scripting" also known as "Support for Assistive Devices"...
- It requires iTunes to be brought to the front and may even have message boxes popup in iTunes on your ooTunes server computer.
- It may not work on non-english versions of iTunes.
- You have to already have the track in your iTunes library, and "Genius" has to be updated since that track was added.
(*
(C) Steven Woolley 2008, as part of ooTunes Media Server (see ootunes.com)
How to create an Genius Playlist in iTunes using applescript. More info and issues discussed here:
http://ootunes.blogspot.com/2008/10/create-genius-playlists-in-itunes-on-go.html
Feel free to use this code however you'd like, but please keep this comment intact so I hear feedback, etc., since I'd like to hear about updates, improvements, suggestions, etc.
*)
set pid to "4B62C662B53FFB94" -- set this to your track's persistent id... or use some other method to get your "seed" track
set app_name to "iTunes"
tell application "iTunes"
try
with timeout of 10 seconds -- don't want to hang forever if, for instance, iTunes has a dialog box already open
set cur_track to (first track of playlist named "Music" whose persistent ID is pid)
reveal cur_track
end timeout
on error theError
return "Can't find track!"
end try
end tell
tell application "System Events"
tell process app_name -- this needs Assistive Devices support enabled see: System Preferences -> Universal Access -> "Enable access for assistive devices"
try
set b to first button of window app_name whose help is "Start Genius." -- that's about the only way to get the "Start Genius" button, but it will break on non-english versions (I'm guessing)
tell application "iTunes"
activate
end tell
click b
with timeout of 1 second -- this is a hack to "test" if the "can't create genius playlist..." dialog opened. If it does, we'll timeout (hopefully) and then close the dialog so it doesn't freeze future applescript interaction
tell application "iTunes"
activate
end tell
end timeout
return ""
on error theError
if theError is "iTunes got an error: AppleEvent timed out." then
key code 36 -- close the dialog
return "Can't create genius list from that track!"
end if
return theError
end try
end tell
return "Error creating genius playlist!"
end tell
Friday, October 10, 2008
Why you can not play live video on the iPhone
- There is nothing built in to the iPhone to handle true rtsp streaming
- The only formats available to be played on the built in video player are .mov, x264 or mpeg4 all of which require a frame index in the moov atom at the beginning in order to be played as they're downloaded. Unfortunately, for a live stream such information is simply not available until the encoding is finished.
- Should you desire to build your own video player, the SDK doesn't give access to the private frameworks that apple uses for video decoding or the raw framebuffer that a player would need to have fast display. There are workarounds (that are suboptimal) but no one can show source thanks to the developer NDA that is still in effect. (technically this comment is probably out of line, though I've gleaned it from reading/searching the web, NOT from the sdk).
- Without proper hardware optimized methods, you're going to be a battery hog, and probably limited in resolution.
- Now, imagining that all of the above is somehow overcome (which I am sure it has been by some)... now the question is: "Will apple accept your app into the store?" It is against the terms of most (if not all) service provider's agreements to stream live anything (and video isn't going to be low bandwidth).
- Figure out a way to encode live video with predictable metadata (fixed frame boundaries and packet sizes)
- Write your own video player from scratch to decode whatever type of stream you want (remember 3, 4 and 5 above)
- File feature enhancements and otherwise petition Apple in hopes that they'll add support for RTSP or change their SDK to allow for this.
- Encode in short snippets and try to play them back to back seamlessly, with no breaks... this way you almost have live video (delayed by the amount of time to encode and start playing a single snippet).
- Give up on it?