Latest 0.1.4
Homepage https://github.com/luckymore0520/MiracastSDK
License MIT
Platforms ios 9.0, requires ARC
Frameworks LocalAuthentication, MobileCoreServices, Photos, SystemConfiguration, MediaPlayer, AVFoundation, MapKit, Foundation, UIKit, CoreGraphics, AudioToolbox, CoreImage, Accelerate, QuartzCore
Authors

[![CI Status](https://img.shields.io/travis/Kun Wang/MiracastSDK.svg?style=flat)](https://travis-ci.org/Kun Wang/MiracastSDK)
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like MiracastSDK in your projects. You can install it with the following command:

$ gem install cocoapods

Podfile

To integrate Miracast into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

target 'TargetName' do
pod 'MiracastSDK'
end

Then, run the following command:

$ pod install

Usage

1.Start searching devices

[[MCWifiManager sharedManager] startMoniting];

2.Use the suspend button(recommanded)

MCSuspendButton *suspendButton = [MCSuspendButton sharedButton];
suspendButton.center = CGPointMake(UIScreen.mainScreen.bounds.size.width - suspendButton.frame.size.width / 2.0, UIScreen.mainScreen.bounds.size.height - 120 - suspendButton.frame.size.height / 2.0);
[self.window addSubview:suspendButton];

3.Use the playBanner(reommanded)

MCPlayerBanner *banner = [MCPlayerBanner sharedBanner];
[self.window addSubview:banner];

4.Manage the Device Mannually

1. Get the searched devices

NSArray *devices = [[MCDeviceManager sharedManager] devices];

2. Observe the searched devices

You can use KVO to observe the change of devices

- (void)observeDevices {
    [[MCDeviceManager sharedManager] addObserver:self
                                       forKeyPath:@"devices"
                                       options:NSKeyValueObservingOptionNew
                                           context:nil];
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
    if ([keyPath isEqualToString:@"devices"]) {
        NSLog(@"%@", change);
    }
}

3. Manage a devices mannually

Read the MCRenderManager.h to control a certain device, including play、pause、resume、stop、adjust the volume、seek、get the state of the media .etc.

Author

Kun Wang, [email protected]

License

MiracastSDK is available under the MIT license. See the LICENSE file for more info.

Package

  • change the tag of MiracastSDK.podspec
  s.source           = { :git => '/Users/yourname/Miracast', :tag => '0.1.3' }
  • commit and add a tag
git add .
git commit -a -m 'MiracastSDK v0.1.3'
git tag -a 0.1.3 -m 'MiracastSDK v0.1.3'
  • install Cocoapods-Package if needed
sudo gem install cocoapods-packager
  • package
pod package MiracastSDK.podspec --library --force
  • replace the libMiracastSDK.a in MiracastSDK_frameworkios

Latest podspec

{
    "name": "MiracastSDK",
    "version": "0.1.4",
    "summary": "MiracastSDK",
    "description": "MiracastSDK",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "njuluckwang": "[email protected]"
    },
    "homepage": "https://github.com/luckymore0520/MiracastSDK",
    "requires_arc": true,
    "source": {
        "git": "https://github.com/luckymore0520/MiracastSDK.git",
        "tag": "0.1.4"
    },
    "platforms": {
        "ios": "9.0"
    },
    "ios": {
        "source_files": [
            "MiracastSDK/Public/*.h"
        ],
        "public_header_files": [
            "MiracastSDK/Public/*.h"
        ],
        "vendored_libraries": "MiracastSDK/libMiracastSDK.a"
    },
    "libraries": [
        "xml2",
        "z"
    ],
    "frameworks": [
        "LocalAuthentication",
        "MobileCoreServices",
        "Photos",
        "SystemConfiguration",
        "MediaPlayer",
        "AVFoundation",
        "MapKit",
        "Foundation",
        "UIKit",
        "CoreGraphics",
        "AudioToolbox",
        "CoreImage",
        "Accelerate",
        "QuartzCore"
    ],
    "resources": "MiracastSDK/Resources/*"
}

Pin It on Pinterest

Share This