mvlc 0.0.1 → 0.0.2

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: 052f8904644cacbb9b81cc9c9e2e72eef3150cb8
4
- data.tar.gz: 88428d64855c4252236e557dd4f68b3748f921a2
3
+ metadata.gz: c8fcc7d1463e23552cf7cdb42fed336baa2924da
4
+ data.tar.gz: ec3be17ea4995f47383f41d06288eb776652c484
5
5
  SHA512:
6
- metadata.gz: e7e0ba57b4fb5f7e33435f6353187dd8ad57c0c282ea5a8fadc769bbfd03914154da75d0e704bc00318517fa3ca5ae970b1e3065a0faa534d9bee845d695cc5c
7
- data.tar.gz: 7c36b2b70a1042f21dac9e9c1ee257a1249c104893b4b422908e564342fd7e10c061cd548bf81f7b08b531cd7a18faee0c0bad59a65addc83d2ad2857fa2cb33
6
+ metadata.gz: 5741c4c5d7bf0ba8f8fccb4738c3f1968328dd16a6f29b0e36e44e5c67fa4f29e7747dac9f23a0a5e7a54456f6b84d89df3878bf4c00544cc57fbdecc423ac5c
7
+ data.tar.gz: 81dfa6df1aaafe596d59cbdbfd15a177bf4879dd2152f942c04bd70f31b1ea2ae09444a6bc904665a886fa97e305656b2ba2809b32531e185d3256bfbd09772b
data/lib/mvlc.rb CHANGED
@@ -24,7 +24,7 @@ require "mvlc/context"
24
24
 
25
25
  module MVLC
26
26
 
27
- VERSION = "0.0.1"
27
+ VERSION = "0.0.2"
28
28
 
29
29
  # Shortcut to Context constructor
30
30
  def self.new(*args, &block)
@@ -27,7 +27,7 @@ module MVLC
27
27
  length_in_seconds = @player.length
28
28
  seconds = length_in_seconds * (percent / 100.0)
29
29
  @player.seek(seconds)
30
- rescue VLC::ReadTimeoutError
30
+ rescue VLC::ReadTimeoutError, VLC::BrokenConnectionError
31
31
  end
32
32
  end
33
33
 
@@ -87,8 +87,7 @@ module MVLC
87
87
  # Cause MPlayer to exit
88
88
  # @return [Boolean]
89
89
  def quit
90
- @player.connection.write("quit")
91
- @player.connection.write("logout")
90
+ @player.server.stop
92
91
  true
93
92
  end
94
93
 
@@ -136,10 +135,18 @@ module MVLC
136
135
  @state.handle_start
137
136
  end
138
137
 
138
+ def playing?
139
+ begin
140
+ @player.playing?
141
+ rescue VLC::ReadTimeoutError, VLC::BrokenConnectionError
142
+ false
143
+ end
144
+ end
145
+
139
146
  # Has the end of a media file been reached?
140
147
  # @return [Boolean]
141
148
  def eof?
142
- @state.eof_reached? && !@player.playing?
149
+ @state.eof_reached? && !playing?
143
150
  end
144
151
 
145
152
  end
@@ -7,6 +7,9 @@ class MVLC::Player::WrapperTest < Minitest::Test
7
7
  setup do
8
8
  @player = Object.new
9
9
  @player.stubs(:quit)
10
+ conn = Object.new
11
+ conn.stubs(:write)
12
+ @player.stubs(:connection).returns(conn)
10
13
  VLC::System.stubs(:new).returns(@player)
11
14
  @player = MVLC::Player::Wrapper.new
12
15
  end
@@ -41,7 +44,6 @@ class MVLC::Player::WrapperTest < Minitest::Test
41
44
 
42
45
  should "lazily invoke mplayer and play" do
43
46
  assert @player.play("file.mov")
44
- #refute_nil @player.instance_variable_get("@player")
45
47
  end
46
48
 
47
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvlc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo