Skip to content

Kalp695/LMMediaPlayer

 
 

Repository files navigation

LMMediaPlayer

LMMediaPlayer is a video and audio player for iPhone with changeable user interface.

Requirements

  • Runs on iOS 6.0 or later.
  • Must be complied with ARC.

Intstallation

First, please add these frameworks.

=== #import <MediaPlayer/MediaPlayer.h> #import <AVFoundation/AVFoundation.h>

Second, add files which is contained "LMMediaPlayer" folder.

That's it.

If you want to play with fullscreen mode, please add "View controller-based status bar appearance" key and set value with "NO" at your Info.plist

Usage

You can play MPMediaItem and http streaming contents with fullscreen or non-fullscreen mode.

=== //Get shared player LMMediaPlayerView *player = [LMMediaPlayerView sharedPlayerView];

//Create media item with URL.
LMMediaItem *item1 = [[LMMediaItem alloc] initWithInfo:@{
	LMMediaItemInfoURLKey:[NSURL URLWithString:@"video or audio url"],
	LMMediaItemInfoURLKey:[NSNumber numberWithInteger:LMMediaItemContentTypeVideo]
}];

//Create media item with MPMediaItem.
MPMediaItem *mediaItem = 
LMMediaItem *item2 = [[LMMediaItem alloc] initWithMetaMedia:mediaItem contentType:LMMediaItemContentTypeVideo];

//Add queue.
[player.mediaPlayer addMedia:item1];
[player.mediaPlayer addMedia:item2];

//Play it!
[player.mediaPlayer play];

===

Already implemented repeat mode and shuffle mode.

=== LMMediaPlayerView *player = [LMMediaPlayerView sharedPlayerView]; player.mediaPlayer.repeatMode = LMMediaRepeatModeNone; player.mediaPlayer.repeatMode = LMMediaRepeatModeAll; player.mediaPlayer.repeatMode = LMMediaRepeatModeOne;

[player.mediaPlayer setShuffleEnabled:YES];

===

Of course, you can play video �or audio in background mode and can control with control center.

Contacts

License

LMMediaPlayer is available under the MIT license.

About

Video and audio player with changeable UI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published