Video Player

The Video Player component is build to play trailers, video, movies and to support almost all file formats. The implementation of Video Player is straightforward. You can implement it manually or using Cocoapod package manager.

Name Version Content
MGVideoPlayerKit 0.1.4 UINavigationBar - UISearchBar - UITableView - UIViewController - VideoPlayer

Installation

To install this component you can use Cocoapods or drag and drop the folder of the component into your project manually.

Cocoapods

MGVideoPlayerKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MGVideoPlayerKit', :git => 'https://haraldbregu:4a4d1162147e80549f22cafb59060bdf59c4934a@github.com/HaraldBregu/MGVideoPlayerKit.git'

Customization

To customize content of VideoPlayer component you have to edit VideoPlayerComponent.swift file. By updating and changing this file you will have different items in the list. Follow the steps below.

Items

Open the file and start edit the content. To change, add or remove items as example:

let item = MGVideoPlayerItem()
item.title = ""
item.description = ""
item.pubYear = ""
item.category = ""
item.starCount = 1
item.reviewCount = 0
item.actors = [
    MGVideoPlayerActorItem(name: "", roleName: "", pictureUrl: "")
]
item.url = URL(string: "")
item.thumbUrl = URL(string: "")
trailerList.append(item)

Assets

To change the items of content, edit this code of lines:

return VideoPlayerAsset(
    string: VideoPlayerString(
        title: "Movie Player",
        navigationBarTitle: "Movie Player",
        detailTitle: "Now Playing",
        detailNavigationBarTitle: "Now Playing",
        searchBarPlaceholder: "Search",
        navigationListPlayerPrompt: nil,
        navigationVideoPlayerPrompt: nil,
        detailTopCastTitle: "Top Casts"),
    font: VideoPlayerFont(
        tableViewCellTitle: MGTemplate.font.title2,
        tableViewCellSubtitle: MGTemplate.font.caption1,
        tableViewCellRating: MGTemplate.font.subhead,
        tableViewCellDescription: MGTemplate.font.footnote,
        detailTitle: MGTemplate.font.title2,
        detailSubtitle: MGTemplate.font.caption1,
        detailRating: MGTemplate.font.subhead,
        detailDescription: MGTemplate.font.footnote,
        detailTopCastTitle: MGTemplate.font.subhead,
        actorListFullname: MGTemplate.font.caption2,
        actorListRolename: MGTemplate.font.caption2),
    image: VideoPlayerImage(
        likeNormal: heart,
        likeSelected: heart0,
        likeHighlighted: heart0),
    color: VideoPlayerColor(
        navigationBar: MGTemplate.color.navigationBar,
        navigationBarContent: MGTemplate.color.text.navigationBar,
        toolBar: MGTemplate.color.toolBar,
        toolBarContent: MGTemplate.color.text.toolBar,
        view: MGTemplate.color.view,
        viewContent: MGTemplate.color.text.primary,
        refreshControl: MGTemplate.color.activityIndicator,
        activityIndicator: MGTemplate.color.activityIndicator,
        tableView: MGTemplate.color.tableView,
        tableViewSeparator: MGTemplate.color.tableViewSeparator,
        searchBarContent: MGTemplate.color.text.primary,
        tableViewCell: MGTemplate.color.tableViewCell,
        tableViewCellContent: MGTemplate.color.text.primary,
        collectionView: MGTemplate.color.collectionView,
        collectionViewContent: MGTemplate.color.text.primary,
        tableViewCellTitle: MGTemplate.color.text.primary,
        tableViewCellSubtitle: MGTemplate.color.text.secondary,
        tableViewCellRating: MGTemplate.color.text.secondary,
        tableViewCellDescription: MGTemplate.color.text.primary,
        detailTopCastTitle: MGTemplate.color.text.primary),
    data: VideoPlayerData(
        items: list,
        keyboardAppearance: .dark,
        statusBarStyle: .default,
        enableAds: RemoteConfig.remoteConfig()["enable_admob_banner"].boolValue,
        adsUnitId: "ca-app-pub-3940256099942544/2934735716",
        listRatingStarSize: (ipad ? 24 : 15),
        playerRatingStarSize: ipad ? 24 : 15))