Short solution for short problems

MPMoviePlayerPlaybackDidFinishNotification results in a black screen

I had a hard time implementing the MPMoviePlayer. After a lot of search and some tutorials, I got what I wanted. But just one last thing was ginning me trouble. The user presses a button in the application to show the movie. Its shown in full screen mode, after the movie is finished the user should come back in the first screen. Here's the code on how I show the video (at the end I add the event DidFinish of the movie player to the notification center.):


- (IBAction)btnPlayVideo:(id)sender 
    MPMoviePlayerController *mov = [[MPMoviePlayerController allocinitWithContentURL:self.videoUrl];


    [mov prepareToPlay];
    mov.view.frame = self.view.bounds;
    mov.scalingMode = MPMovieScalingModeAspectFit;
    mov.movieSourceType = MPMovieSourceTypeFile;
    mov.controlStyle = MPMovieControlStyleDefault;
    self.moviePlayer = mov;
    [self.view addSubview:self.moviePlayer.view];
    self.moviePlayer.initialPlaybackTime = 0,0;
    [self.moviePlayer setFullscreen:YES animated:YES];
    [self.moviePlayer prepareToPlay];
    [self.moviePlayer play];


    [[NSNotificationCenter defaultCenteraddObserver:self selector:@selector(moviePlayBackComplete:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer ];


The problem was that when the movie is finished, I get a black screen and nothing is possible anymore in the application. The app is completely blocked. So I searched some and first somebody suggested to stop the movie before removing the player from the super view. But that didn't work. then another suggested to set the control style to none before removing it. Still nothing happened, but the last try was close to the solution I found there after. I had to set the control style to embedded before removing it. Here the code that worked for me at the end:

- (void) moviePlayBackComplete:(NSNotification *)notification


    MPMoviePlayerController *moviePlayer = [notification object];

    [[NSNotificationCenterdefaultCenter] removeObserver:selfname:MPMoviePlayerPlaybackDidFinishNotificationobject: moviePlayer];


    [moviePlayer setFullscreen: NO animatedYES];   


    [moviePlayer stop ];

    [moviePlayer setControlStyle:MPMovieControlStyleEmbedded];

    [moviePlayer.view removeFromSuperview];



It only worked every time after I added the line: setFullscreen: NO animated: YES. So the 

Free movie, CD and books database part 2

The first version is almost ready to be published. Here's a screenshot of the configuration part.

As you can see, you can select an automatic backup. You can manually backup and restore files. Also you can disable functions, for example if you are not using the movie database:

Only the tesing fase and then the first version will be released. When you are using them, all data is stored in a format that is supported for future versions. so start using it as soon as it becomes available. then you can get the new version just as free as you are getting this one!

Read part 1.

Free movie, books and CD database part 1

Recently I started a new project, for personal use. I have a large collection of CD's and DVD's, this taking up more and more place. So now I was looking for software to keep an inventory of all these multimedia. I could find some, but the most interesting where not free. So I decided to make my own. This is a really nice porject in which I try some new stuff. When it is ready I will make it as a free download including the source code. For now you it will cover 3 types of multimedia: Audio CD's, Movies and books. There is a build in lend out system and some other cool stuff. I choose not to overload the objects with to much properties.

Here's a first look at the program:

I store all data in XML files. When data is first called I cache it, so the program runs smoothly. Since it is only text, it will not take to much memory.  

The caching is something I'm looking into with much interest. Before you start caching, you'll have to look into what to cache and when. For example, you could load all data at program startup, but then the startup takes long. The program I'm making consists of 3 big parts, Audio, Video and Books. I will create the system so that you can disable and enable these functionalities, so this makes caching more complicated. It's really fun to think of the best and most performant ways to cache.

What I also will implement in the system is an online update. I got some ideas in my head, just trying them out as soon as the first version of the program is almost ready. It's offcourse important to have the update procedure ready before I will release the first version.

I can assure you that you will find updates on this program on regular basis. It's a hobby!

So the first version is ready for publication. You will find it soon as a download on this site. The last step is testing and user manual generation. My wife will do the end user testing and I will generete a short manual.

Read more about this in the second part 2. 

Greetings and God bless this world!