vlc-client 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9195752c1e3f892ffc1d20509a533f195088591
4
- data.tar.gz: 7b921a75027b04fcc866460727cc887ce68f8b4f
3
+ metadata.gz: 2bf06f6577ac01caa2f087f52810c0f9f8f9d909
4
+ data.tar.gz: 28223c029ee4a5df6eaa988f724766e9fcaae4e6
5
5
  SHA512:
6
- metadata.gz: 550e57fc4986d746c42ee7e45bc34ed022633a50c4007ed66d4438c68271fa93934294fa0b69961276b17b558aa50b803c1730d8d6f97ad0cb1c5572b1d50957
7
- data.tar.gz: d680adf103db6d10dbcfbc6d99f7ca5ed6d30ce444935db395fd60eba9cee49709b1a954d46011c0a5ce8be660f1b6383e382d49d2cb46f57a4789b36357995b
6
+ metadata.gz: 5103d85a95e92e33f8a7a07b42f4882517888dd38e49217cb8d3cabdc70171b7e848f480dde1443a99543bd2e20de2419a451d2baee2077cdda442252bfabbb3
7
+ data.tar.gz: 1f4271b37a1a6e2058e98edf66747d9f10c0558867cf7bd47ba52a1ea558d79dbddf0b5a81df5a06824ba39cf648fec65304e9aeceef8f30b8a954060deb9475
@@ -12,3 +12,4 @@ rvm:
12
12
  - 2.0.0
13
13
  - 2.1.0
14
14
  - ruby-head
15
+
data/Gemfile CHANGED
@@ -10,10 +10,11 @@ group :development do
10
10
  end
11
11
 
12
12
  group :test do
13
- gem 'mime-types', '< 2.0.0'
14
- gem 'rspec', '~> 2.14.1', :require => false
15
- gem 'simplecov', :require => false
16
- gem 'coveralls', :require => false
13
+ gem 'mime-types', '< 2.0.0'
14
+ gem 'rspec', '~> 2.14.1', :require => false
15
+ gem 'simplecov', '~> 0.8.2', :require => false
16
+ gem 'coveralls', '~> 0.7.0', :require => false
17
+ gem 'rest-client', '~> 1.6.7', :require => false
17
18
  end
18
19
 
19
20
  gemspec
data/README.md CHANGED
@@ -90,11 +90,11 @@ vlc.connect
90
90
 
91
91
  ## Notice
92
92
 
93
- vlc-client has been tested on linux but it should work on any VLC installation as long as the command line is responsive for `vlc` and `cvlc` calls. On Mac OSX these are not available by default. They can be created with:
93
+ vlc-client has been tested on linux but it should work on any VLC installation as long as the command line is responsive for `vlc` and `cvlc` calls. On Mac OS X these are not available by default. They can be created with:
94
94
 
95
95
  ```
96
- ln -s /Applications/VLC.app/Contents/MacOS/VLC /usr/local/bin/vlc
97
- ln -s /Applications/VLC.app/Contents/MacOS/VLC /usr/local/bin/cvlc
96
+ echo "alias vlc='/Applications/VLC.app/Contents/MacOS/VLC'" >> ~/.bash_profile
97
+ echo "alias cvlc='/Applications/VLC.app/Contents/MacOS/VLC'" >> ~/.bash_profile
98
98
  ```
99
99
 
100
100
  VLC media player 2.0.3 seems to [ship with a bug](http://www.linuxquestions.org/questions/slackware-14/problem-vlc-2-0-3-playing-youtube-videos-4175429135) that invalidates YouTube streaming.
@@ -30,6 +30,11 @@ module VLC
30
30
  connection.write("pause")
31
31
  end
32
32
 
33
+ # Seek in seconds
34
+ def seek(seconds = 0)
35
+ connection.write("seek #{seconds.to_i}")
36
+ end
37
+
33
38
  # Stops media currently playing
34
39
  def stop
35
40
  connection.write("stop")
@@ -98,6 +98,13 @@ module VLC
98
98
  :in => 'NUL',
99
99
  :out => 'NUL',
100
100
  :err => 'NUL')
101
+ elsif (/darwin/ =~ RUBY_PLATFORM) != nil
102
+ Process.spawn('/Applications/VLC.app/Contents/MacOS/VLC',
103
+ '--extraintf', 'rc', '--rc-host', "#{@host}:#{@port}",
104
+ :pgroup => detached,
105
+ :in => '/dev/null',
106
+ :out => '/dev/null',
107
+ :err => '/dev/null')
101
108
  else
102
109
  Process.spawn(headless? ? 'cvlc' : 'vlc',
103
110
  '--extraintf', 'rc', '--rc-host', "#{@host}:#{@port}",
@@ -1,3 +1,3 @@
1
1
  module VLC
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -99,6 +99,20 @@ describe VLC::Client::MediaControls do
99
99
  vlc.should be_playing
100
100
  end
101
101
 
102
+ it 'may seek' do
103
+ tcp = tcp_mock
104
+
105
+ tcp.should_receive(:puts).once.with('seek 120')
106
+ tcp.should_receive(:puts).once.with('get_time')
107
+ tcp.should_receive(:gets).once.and_return('120')
108
+
109
+ vlc.connect
110
+ vlc.play('http://example.org/media.mp3')
111
+
112
+ vlc.seek(60 * 2)
113
+ vlc.time.should eq(120)
114
+ end
115
+
102
116
  it 'displays the playing media title' do
103
117
  tcp = tcp_mock
104
118
  tcp.should_receive(:puts).once.with('get_title')
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlc-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Guinada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: retryable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  description: vlc-client allows to control VLC media player over TCP
@@ -31,10 +31,10 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - .gitignore
35
- - .rspec
36
- - .travis.yml
37
- - .yardopts
34
+ - ".gitignore"
35
+ - ".rspec"
36
+ - ".travis.yml"
37
+ - ".yardopts"
38
38
  - Gemfile
39
39
  - LICENSE
40
40
  - README.md
@@ -70,17 +70,17 @@ require_paths:
70
70
  - lib
71
71
  required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.1.11
83
+ rubygems_version: 2.2.2
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: vlc-client is a TCP client for VLC media player