Skip to content

Commit

Permalink
add media type method
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro committed Oct 5, 2012
1 parent fe980b8 commit d0dd60f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/airplayer/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ def initialize(target)
end

def open
if @type == :file
Thread.start { @video_server.start }
end
Thread.start { @video_server.start } if file?
@path
end

def close
@video_server.stop if @type == :local
@video_server.stop if file?
end

def file?
@type == :file
end

def url?
@type == :url
end
end
end

0 comments on commit d0dd60f

Please sign in to comment.