This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Include NSNotificationCenter in require 'media'

Also change examples to not use `App.`, which is
only in `bw/core`.
  • Loading branch information...
clayallsopp committed Jul 22, 2012
1 parent b6a243e commit 55edeb86e43508ad426880dd8c048a5f1cafdb55
Showing with 3 additions and 2 deletions.
  1. +1 −1 README.md
  2. +1 −0 lib/bubble-wrap/media.rb
  3. +1 −1 motion/media/player.rb
View
@@ -354,7 +354,7 @@ Added wrapper for playing remote and local media. Available are `modal` and cust
```ruby
# Plays in your custom frame
-local_file = File.join(App.resources_path, 'test.mp3')
+local_file = File.join(NSBundle.mainBundle.resourcePath, 'test.mp3')
BW::Media.play(NSURL.fileURLWithPath(local_file)) do |media_player|
media_player.view.frame = [[10, 100], [100, 100]]
self.view.addSubview media_player.view
View
@@ -1,5 +1,6 @@
require 'bubble-wrap/loader'
BubbleWrap.require('motion/core/string.rb')
+BubbleWrap.require('motion/core/ns_notification_center.rb')
BubbleWrap.require('motion/media/**/*.rb') do
file('motion/media/media.rb').depends_on('motion/media/player.rb')
file('motion/media/player.rb').depends_on 'motion/core/string.rb'
View
@@ -81,7 +81,7 @@ def play(content_url, options = {}, &block)
end
}
- App.notification_center.observe MPMoviePlayerPlaybackDidFinishNotification do |notification|
+ NSNotificationCenter.defaultCenter.observe MPMoviePlayerPlaybackDidFinishNotification do |notification|
h = notification.userInfo
error = h["error"]
if error

0 comments on commit 55edeb8

Please sign in to comment.