¡@

Home 

2014/10/15 ¤U¤È 10:12:42

iphone Programming Glossary: player

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

but this isn't working. NSUserDefaults setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in.. setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've.. ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types of information...

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

methods. For video playing I use MPMoviePlayerViewController . How to rotate only this player view I can only rotate whole app but don't want to do this. I present MPMoviePlayerViewController but.. interface orientation. If I set other whole app will be rotated. iphone objective c ios mpmovieplayercontroller ios6 share improve this question From Apple's iOS 6 SDK Release Notes Autorotation is..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

of my Custom class Player @interface Player NSObject NSString name NSNumber life Log of player's life Getting functions return the info NSString name int life id init These are the setters void setName.. some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name.. @ @ n d n d singlePlayer name singlePlayer life singlePlayer psnCounters test Encode the single player so it can be stored in UserDefaults id test MagicApp201AppDelegate new test saveCustomObject singlePlayer..

HTML5 inline video on iPhone vs iPad/Browser

http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser

inline video on iPhone vs iPad Browser I've created an HTML5 video player very simple that works perfectly on the iPad and the browser. However when I open it on the iPhone I.. when I open it on the iPhone I only get a play button which when pressed opens the native video player on a new window on top of all my stuff. That means I lose access to my custom controls and time tracking.. property on the UIWebView. So in the end this is what it looks like HTML video id player width 480 height 320 webkit playsinline Obj C webview.allowsInlineMediaPlayback YES And all works just..

Play sound on iPhone even in silent mode

http://stackoverflow.com/questions/3740528/play-sound-on-iphone-even-in-silent-mode

type of sound whether music or system tones when it is silent mode iphone objective c ipad avaudioplayer share improve this question It's not advisable but who am I to say you can't do it. You may have.. plays the sounds you can instanciate sounds like this probably an instance variable AVAudioPlayer player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer.. player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer alloc initWithContentsOfURL url When that's done you can play with it any time you want..

Can I use CGAffineTransformMakeRotation to rotate a view more than 360 degrees?

http://stackoverflow.com/questions/542739/can-i-use-cgaffinetransformmakerotation-to-rotate-a-view-more-than-360-degrees

CGAffineTransformIdentity 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation.. 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation to say 4 M_PI it doesn't..

program access to iPhone volume buttons

http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons

there The only way to do this now is to have an AVAudioPlayer prepared to play but not playing player prepareToPlay . This seems to take care of adjusting the app's volume according to the rocker buttons...

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

Before I was putting all my information in NSUserDefaults but this isn't working. NSUserDefaults setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults.. my information in NSUserDefaults but this isn't working. NSUserDefaults setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types.. setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types of information. So how an I get my objects into NSUSerDefaults I read..

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

now I need to use shouldAutoRotate and supportedInterfaceOrientations methods. For video playing I use MPMoviePlayerViewController . How to rotate only this player view I can only rotate whole app but don't want to do this. I present MPMoviePlayerViewController but it doesn't rotate as in iOS 5 and earlier. In plist setting.. iOS 5 and earlier. In plist setting I've set only 1 Portrait interface orientation. If I set other whole app will be rotated. iphone objective c ios mpmovieplayercontroller ios6 share improve this question From Apple's iOS 6 SDK Release Notes Autorotation is changing in iOS 6. In iOS 6 the shouldAutorotateToInterfaceOrientation..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

basic and I'm just too tired but we'll see. Here is the implementation of my Custom class Player @interface Player NSObject NSString name NSNumber life Log of player's life Getting functions return the info NSString name int life id init These are the setters void setName NSString input string void setLife NSNumber input number.. NSUserDefaults standardUserDefaults First check to see if some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name singlePlayer life singlePlayer psnCounters test Encode the.. Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name singlePlayer life singlePlayer psnCounters test Encode the single player so it can be stored in UserDefaults id test MagicApp201AppDelegate new test saveCustomObject singlePlayer test release prefs synchronize void saveCustomObject Player..

HTML5 inline video on iPhone vs iPad/Browser

http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser

inline video on iPhone vs iPad Browser I've created an HTML5 video player very simple that works perfectly on the iPad and the browser. However when I open it on the iPhone I only get a play button which when pressed opens the native.. that works perfectly on the iPad and the browser. However when I open it on the iPhone I only get a play button which when pressed opens the native video player on a new window on top of all my stuff. That means I lose access to my custom controls and time tracking written in Javascript since the video is now running isolated... to the video tag on the HTML as well as adding the allowsInlineMediaPlayback property on the UIWebView. So in the end this is what it looks like HTML video id player width 480 height 320 webkit playsinline Obj C webview.allowsInlineMediaPlayback YES And all works just fine Hope this helps someone as it's virtually undocumented..

Play sound on iPhone even in silent mode

http://stackoverflow.com/questions/3740528/play-sound-on-iphone-even-in-silent-mode

an iPhone is in silent mode. Is it possible to play any type of sound whether music or system tones when it is silent mode iphone objective c ipad avaudioplayer share improve this question It's not advisable but who am I to say you can't do it. You may have a good reason to be playing sound. If you are using Audio Sessions.. somewhere in the initialisation of one of your classes that plays the sounds you can instanciate sounds like this probably an instance variable AVAudioPlayer player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer alloc initWithContentsOfURL url When that's done.. sounds like this probably an instance variable AVAudioPlayer player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer alloc initWithContentsOfURL url When that's done you can play with it any time you want with player play Play the sound player pause Pause the sound..

Can I use CGAffineTransformMakeRotation to rotate a view more than 360 degrees?

http://stackoverflow.com/questions/542739/can-i-use-cgaffinetransformmakerotation-to-rotate-a-view-more-than-360-degrees

wrapped in a beginAnimations commitAnimations block scale CGAffineTransformScale CGAffineTransformIdentity 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation to say 4 M_PI it doesn't rotate at all. Is it possible to get.. commitAnimations block scale CGAffineTransformScale CGAffineTransformIdentity 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation to say 4 M_PI it doesn't rotate at all. Is it possible to get a 720 rotation using CGAffineTransformRotate..

program access to iPhone volume buttons

http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons

quite some apps on the App Store use this already and are still there The only way to do this now is to have an AVAudioPlayer prepared to play but not playing player prepareToPlay . This seems to take care of adjusting the app's volume according to the rocker buttons. There's no other published way currently to handle this...

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

supportedInterfaceOrientations methods. For video playing I use MPMoviePlayerViewController . How to rotate only this player view I can only rotate whole app but don't want to do this. I present MPMoviePlayerViewController but it doesn't rotate.. set only 1 Portrait interface orientation. If I set other whole app will be rotated. iphone objective c ios mpmovieplayercontroller ios6 share improve this question From Apple's iOS 6 SDK Release Notes Autorotation is changing in iOS 6. In..

On iPhone: Find out what song is currently playing? (in the iPod music player)

http://stackoverflow.com/questions/1917014/on-iphone-find-out-what-song-is-currently-playing-in-the-ipod-music-player

iPhone Find out what song is currently playing in the iPod music player Apple released access to the iPod Library in the iPhone SDK 3.0 and I'm wondering if it's now possible to understand which..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

Here is the implementation of my Custom class Player @interface Player NSObject NSString name NSNumber life Log of player's life Getting functions return the info NSString name int life id init These are the setters void setName NSString input.. check to see if some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name singlePlayer life.. alloc initWithFormat @ @ n d n d singlePlayer name singlePlayer life singlePlayer psnCounters test Encode the single player so it can be stored in UserDefaults id test MagicApp201AppDelegate new test saveCustomObject singlePlayer test release prefs..

What is the maximum sandbox size on iPad?

http://stackoverflow.com/questions/2953052/what-is-the-maximum-sandbox-size-on-ipad

is the maximum sandbox size on iPad I'm writing an iPad app that acts as a media player video and photos . I know there is a 2GB size limit on apps however is this the size limit on an app when downloaded Or..

iPad/iPhone browser crashing when loading images in Javascript

http://stackoverflow.com/questions/2986039/ipad-iphone-browser-crashing-when-loading-images-in-javascript

code as the culprit. Given that you can stream much more than a few MB in a element or through the in browser media player this limit seems unnecessary and there should be some kind of workaround available. Perhaps by freeing up memory or something..

Adjusting the volume of a playing AVPlayer

http://stackoverflow.com/questions/3268949/adjusting-the-volume-of-a-playing-avplayer

convoluted to simply manage volume levels I cannot use an AVAudioPlayer because I need to load iTunes tracks into the player. iphone objective c ios4 share improve this question You can change the volume while playing using the method described.. is playing. For example assuming your instance of AVAsset is called asset your instance of AVPlayerItem is called playerItem and the volume you want to set is called volume the following code should do what you want NSArray audioTracks asset..

HTML5 inline video on iPhone vs iPad/Browser

http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser

inline video on iPhone vs iPad Browser I've created an HTML5 video player very simple that works perfectly on the iPad and the browser. However when I open it on the iPhone I only get a play button.. the browser. However when I open it on the iPhone I only get a play button which when pressed opens the native video player on a new window on top of all my stuff. That means I lose access to my custom controls and time tracking written in Javascript.. adding the allowsInlineMediaPlayback property on the UIWebView. So in the end this is what it looks like HTML video id player width 480 height 320 webkit playsinline Obj C webview.allowsInlineMediaPlayback YES And all works just fine Hope this helps..

Play sound on iPhone even in silent mode

http://stackoverflow.com/questions/3740528/play-sound-on-iphone-even-in-silent-mode

to play any type of sound whether music or system tones when it is silent mode iphone objective c ipad avaudioplayer share improve this question It's not advisable but who am I to say you can't do it. You may have a good reason to be.. of your classes that plays the sounds you can instanciate sounds like this probably an instance variable AVAudioPlayer player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer alloc initWithContentsOfURL.. AVAudioPlayer player NSString path NSBundle mainBundle pathForResource... NSURL url NSURL fileURLWithPath path player AVAudioPlayer alloc initWithContentsOfURL url When that's done you can play with it any time you want with player play Play..

Making the iPhone vibrate

http://stackoverflow.com/questions/4724980/making-the-iphone-vibrate

the iPhone vibrate How can the iPhone be set to vibrate once For example when a player loses a life or the game is over the iPhone should vibrate. iphone objective c ios vibrate share improve this question..

Save Youtube video to iPhone in the app

http://stackoverflow.com/questions/5087249/save-youtube-video-to-iphone-in-the-app

Youtube video in the app is easy and well documented around. There are two problems with that after closing Youtube player if user wants to play it again it has to wait for online streaming again can't play offline load video at home to watch..

Can I use CGAffineTransformMakeRotation to rotate a view more than 360 degrees?

http://stackoverflow.com/questions/542739/can-i-use-cgaffinetransformmakerotation-to-rotate-a-view-more-than-360-degrees

block scale CGAffineTransformScale CGAffineTransformIdentity 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation to say 4 M_PI it doesn't.. CGAffineTransformIdentity 5.0f 5.0f swirl CGAffineTransformRotate scale M_PI player setTransform swirl player setAlpha 0.0f But I find that if I try to change the angle of the rotation to say 4 M_PI it doesn't rotate at all. Is it..

program access to iPhone volume buttons

http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons

already and are still there The only way to do this now is to have an AVAudioPlayer prepared to play but not playing player prepareToPlay . This seems to take care of adjusting the app's volume according to the rocker buttons. There's no other..

Application crashed while importing songs from Ipod library in Iphone for iOs 5.0

http://stackoverflow.com/questions/8077725/application-crashed-while-importing-songs-from-ipod-library-in-iphone-for-ios-5

We need to dismiss the picker self dismissModalViewControllerAnimated YES Assign the selected item s to the music player and start playback. counterIpod mediaItemCollection.items count totalcollection counterIpod if totalcollection 10 NSString..

UIWebView Movie Player getting dismissed iOS 6 bug

http://stackoverflow.com/questions/12660857/uiwebview-movie-player-getting-dismissed-ios-6-bug

Movie Player getting dismissed iOS 6 bug When I try to initiate a video to play via YouTube in a UIWebView the video opens then the.. MPAVController Autoplay Skipping autoplay disabled for current item 0 on player 1 Here's a similar question MPMoviePlayerController stops playing after a few seconds this is the code im using My only problem is that with a UIWebView I can't set.. after a few seconds this is the code im using My only problem is that with a UIWebView I can't set up an MPMoviePlayerController to prepareToPlay . At least not as far as my knowledge goes. If anyone can help fix this problem that would be..

Video file formats supported in iPhone

http://stackoverflow.com/questions/1535836/video-file-formats-supported-in-iphone

Quoting the iPhone OS Technology Overview iPhone OS provides support for full screen video playback through the Media Player framework MediaPlayer.framework . This framework supports the playback of movie files with the .mov .mp4 .m4v and .3gp filename.. Technology Overview iPhone OS provides support for full screen video playback through the Media Player framework MediaPlayer.framework . This framework supports the playback of movie files with the .mov .mp4 .m4v and .3gp filename extensions and..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

in NSUserDefaults but this isn't working. NSUserDefaults setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults... isn't working. NSUserDefaults setObject forKey Attempt to insert non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently.. non property value ' Player 0x3b0cc90 ' of class 'Player'. That is the error message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types of information. So how an..

iPhone: AVAudioPlayer unsupported file type

http://stackoverflow.com/questions/4901709/iphone-avaudioplayer-unsupported-file-type

AVAudioPlayer unsupported file type My app downloads an mp3 from our server and plays it back to the user. The file is 64 kbps which.. do exactly this NSData data NSData dataWithContentsOfURL NSURL URLWithString @ http ... file.mp3 NSError e nil AVAudioPlayer player AVAudioPlayer alloc initWithData data error e player setDelegate self When I run the code player comes back null.. data NSData dataWithContentsOfURL NSURL URLWithString @ http ... file.mp3 NSError e nil AVAudioPlayer player AVAudioPlayer alloc initWithData data error e player setDelegate self When I run the code player comes back null and I get this error..