Code Monkey home page Code Monkey logo

miracastsdk's Introduction

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.4' }
  • 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_framework\ios

miracastsdk's People

Contributors

luckymore0520 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.