airvideo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +26 -0
- data/VERSION +1 -1
- data/lib/airvideo.rb +6 -0
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -5,11 +5,37 @@ that not only have I bought the iPhone and iPad apps, I'd also love to be able t
|
|
5
5
|
Me too! So I reverse engineered their communication protocol and came up with this. It's a little hacky (and it's certainly not been tested outside of Mac OS X 10.6)
|
6
6
|
but it will give you the Streamable and Playable URLs of the videos on your AirVideo server from Ruby.
|
7
7
|
|
8
|
+
== Care & Share
|
9
|
+
I know you know this, but the guys at InMethod don't charge for their server. Purchases of their iPhone and iPad apps are how they get rewarded for their (epic, as I'm sure you'll agree) efforts.
|
10
|
+
|
11
|
+
Please, buy their apps if you haven't already, and send them an email or a forum post saying how much you love their software. If you're a member of InMethod, come to Nottingham in the UK - I'll buy you a pint.
|
12
|
+
|
8
13
|
== Usage
|
9
14
|
I'd like to be able to write a shiny GUI for all this, but alas, I am crap at the GUI. So as it stands you'll need to do this:
|
10
15
|
|
11
16
|
my_vids = AirVideo::Client.new('me.dyndns.org',45631,'YOUR PASSWORD')
|
12
17
|
# => <AirVideo Connection: me.dyndns.org:45631>
|
13
18
|
my_vids.ls
|
19
|
+
# => [<Folder: TV Shows>, <Folder: Movies>, <Folder: Music Videos>]
|
20
|
+
my_vids.ls[2].cd
|
21
|
+
|
22
|
+
# Bear in mind that the AirVideo::Client instance keeps track of where you are, like a console.
|
23
|
+
my_vids.ls
|
24
|
+
# => [<Video: Star Guitar>, <Video: A Glorious Dawn>, <Video: Stylo (Featuring Mos Def & Bobby Womack)>]
|
25
|
+
|
26
|
+
sagan = my_vids.ls[1]
|
27
|
+
# => <Video: A Glorious Dawn>
|
28
|
+
# Now you can select a video and get the streaming URL
|
29
|
+
sagan.url
|
30
|
+
# => "http://me.dyndns.org:45631/path_to_your.m4v"
|
31
|
+
|
32
|
+
# You can also specify (basic, for now) details as to how you want that file live transcoded to you!
|
33
|
+
my_vids.max_width = 640
|
34
|
+
my_vids.max_height = 480
|
35
|
+
sagan.live_url
|
36
|
+
# => "http://me.dyndns.org:45631/path_to_your_live_converting_resized.m4v"
|
37
|
+
|
38
|
+
# On a mac you can do this, but I'm sure you handsome folk can figure out how to do something similar on other OSes.
|
39
|
+
`open -a "QuickTime Player" "#{sagan.url}"`
|
14
40
|
|
15
41
|
If you have the ENV['HTTP_PROXY'] variable set (to something like 'myproxy.com:8080') then everything will be piped through there too.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/airvideo.rb
CHANGED
@@ -42,6 +42,7 @@ module AirVideo
|
|
42
42
|
|
43
43
|
# Lists the folders and videos in the current directory as an Array of AirVideo::FileObject and AirVideo::FolderObject objects.
|
44
44
|
def ls(dir = ".")
|
45
|
+
dir = dir.location if dir.is_a? FolderObject
|
45
46
|
dir = File.expand_path(dir,@current_dir)[1..-1]
|
46
47
|
dir = nil if dir == ""
|
47
48
|
begin
|
@@ -167,6 +168,11 @@ module AirVideo
|
|
167
168
|
def cd
|
168
169
|
@server.cd(self)
|
169
170
|
end
|
171
|
+
|
172
|
+
# A helper method that will list the contents of this directory.
|
173
|
+
def ls
|
174
|
+
@server.ls(self)
|
175
|
+
end
|
170
176
|
|
171
177
|
def inspect
|
172
178
|
"<Folder: #{(name.nil?) ? "/Unknown/" : name}>"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airvideo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- JP Hastings-Spital
|