Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. [[NSNotificationCenter defaultCenter] addObserver:self
  2. selector:@selector(playingItemDidEnd:)
  3. name:AVPlayerItemDidPlayToEndTimeNotification
  4. object:iPodPlayer];
  5.  
  6.  
  7. [[NSNotificationCenter defaultCenter] addObserver:self
  8. selector:@selector(playingItemDidEnd:)
  9. name:AVPlayerItemDidPlayToEndTimeNotification
  10. object:applicationPlayer ];
  11.  
  12. - (void)playingItemDidEnd:(NSNotification *)notification
  13. {
  14. id object= [notification object];
  15.  
  16. if(object==ipodPlayer)
  17. {
  18. printf("n Notification from iPod Player ");
  19.  
  20. }
  21. else if(object==applicationPlayer)
  22. {
  23. printf("n Notification from application Player ");
  24. }
  25.  
  26. [[NSNotificationCenter defaultCenter] addObserver:self
  27. selector:@selector(playingItemDidEnd:)
  28. name:AVPlayerItemDidPlayToEndTimeNotification
  29. object:[applicationPlayer currentItem] ];
  30.  
  31. [[NSNotificationCenter defaultCenter] addObserver:self
  32. selector:@selector(playingItemDidEnd:)
  33. name:AVPlayerItemDidPlayToEndTimeNotification
  34. object:[iPodPlayer currentItem]];
  35.  
  36. - (void)playingItemDidEnd:(NSNotification *)notification
  37.  
  38. AVPlayerItem* object= [notification object];
  39. if(object==[applicationPlayer currentItem])
  40. {
  41.  
  42. }
  43. else if(object==[avPlayer currentItem])
  44. {
  45.  
  46. }
Add Comment
Please, Sign In to add comment