![]() |
IOS Streaming Browser 1.0
An IOS streaming browser to stream the display to others or to a projector
|
#import <IOS_Streaming_BrowserViewController.h>
Public Member Functions | |
(void) | - displayInfoUpdate: |
(IBAction) | - handleStartStopTapped: |
(IBAction) | - gotoAddress: |
(IBAction) | - goBack: |
(IBAction) | - goForward: |
(IBAction) | - goHome: |
(IBAction) | - reloadPage: |
(IBAction) | - stopLoading: |
(IBAction) | - configureButton: |
(void) | - startRecording |
(void) | - stopRecording |
(UIImage *) | - screenshot |
Protected Attributes | |
NSTimer * | clockTimer |
NSTimer * | assetWriterTimer |
AVMutableComposition * | mutableComposition |
AVAssetWriter * | assetWriter |
AVAssetWriterInput * | assetWriterInput |
AVAssetWriterInputPixelBufferAdaptor * | assetWriterPixelBufferAdaptor |
CFAbsoluteTime | firstFrameWallClockTime |
IBOutlet UIWebView * | webView |
IBOutlet UITextField * | addressBar |
IBOutlet UIActivityIndicatorView * | activityIndicator |
IBOutlet UILabel * | displayInfo |
NSDictionary * | addresses |
HTTPServer * | httpServer |
Properties | |
IBOutlet UIButton * | startStopButton |
UIWebView * | webView |
UITextField * | addressBar |
UIActivityIndicatorView * | activityIndicator |
Definition at line 17 of file IOS_Streaming_BrowserViewController.h.
- (IBAction) configureButton: | (id) | sender |
param id returns IBAction
Upon the configure button being pressed param id returns IBAction
Definition at line 441 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"configureButton"); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Note" message:@"Feature not available in free version" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; }
- (void) displayInfoUpdate: | (NSNotification *) | notification |
param NSNotification
Updates the broadcast ip/port label on the view param NSNotification
Definition at line 757 of file IOS_Streaming_BrowserViewController.m.
:(NSNotification *) notification { DDLogError(@"displayInfoUpdate:"); if(notification) { [addresses release]; addresses = [[notification object] copy]; DDLogError(@"addresses: %@", addresses); } // Return if the notification doesn't contain an address if(addresses == nil) { return; } NSString *info; UInt16 port = [httpServer port]; // get http server port NSString *localIP = nil; localIP = [addresses objectForKey:@"en0"]; if (!localIP) { localIP = [addresses objectForKey:@"en1"]; } if (!localIP) { info = @"Wifi: No Connection!\n"; }else{ info = [NSString stringWithFormat:@" http://%@:%d\n",localIP, port]; } displayInfo.text = info; }
- (IBAction) goBack: | (id) | sender |
param id returns IBAction
Upon the back button being pressed on the webview param id returns IBAction
Definition at line 430 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"goBack"); [webView goBack]; }
- (IBAction) goForward: | (id) | sender |
param id returns IBAction
Upon the forward button being pressed on the webview param id returns IBAction
Definition at line 460 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"goForward"); [webView goForward]; }
- (IBAction) goHome: | (id) | sender |
param id returns IBAction
Upon the Home button being pressed on the webview param id returns IBAction
Definition at line 497 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"goHome"); // Set the defaults web address to load NSString *urlAddress = @"http://www.google.com/webhp?safe=strict"; NSURL *url = [NSURL URLWithString:urlAddress]; NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; [addressBar setText:urlAddress]; }
- (IBAction) gotoAddress: | (id) | sender |
param id returns IBAction
Gets the address from the address bar, and updates the webview with the requested URL param id returns IBAction
Definition at line 407 of file IOS_Streaming_BrowserViewController.m.
:(id) sender { DDLogError(@"gotoAddress"); // Gets the text from the address bar NSURL *url = [NSURL URLWithString:[addressBar text]]; // Creates a request for the URL in the address bar NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url]; //Load the request in the UIWebView. [webView loadRequest:requestObj]; // Set the address bar as the first responder [addressBar resignFirstResponder]; }
- (IBAction) handleStartStopTapped: | (id) | sender |
param id returns IBAction
Upon the start/stop button being pressed param id returns IBAction
Definition at line 383 of file IOS_Streaming_BrowserViewController.m.
: (id) sender { DDLogError(@"handleStartStopTapped"); if (self.startStopButton.selected) { // stop recording and deselect [self stopRecording]; self.startStopButton.selected = NO; [startStopButton setTitle:@"Start Broadcasting" forState:UIControlStateNormal]; } else { // start recording and set the button as selected [self startRecording]; self.startStopButton.selected = YES; [startStopButton setTitle:@"Stop Broadcasting" forState:UIControlStateSelected]; } }
- (IBAction) reloadPage: | (id) | sender |
param id returns IBAction
Upon the reload image beinging pressed on the webview param id returns IBAction
Definition at line 472 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"reloadPage"); [webView reload]; }
- (UIImage*) screenshot |
Take a screen shot
- (void) startRecording |
Start recording
- (IBAction) stopLoading: | (id) | sender |
param id returns IBAction
Upon the stop loading button beinging pressed on the webview param id returns IBAction
Definition at line 484 of file IOS_Streaming_BrowserViewController.m.
:(id)sender { DDLogError(@"stopLoading"); [webView stopLoading]; }
- (void) stopRecording |
Stop recording
- (IBOutlet UIActivityIndicatorView*) activityIndicator [protected] |
Indicator is a “gear” that is animated to spin.
Definition at line 69 of file IOS_Streaming_BrowserViewController.h.
- (IBOutlet UITextField*) addressBar [protected] |
The address bar in the xib file
Definition at line 64 of file IOS_Streaming_BrowserViewController.h.
- (NSDictionary*) addresses [protected] |
Dictionary containing the search addresses
Definition at line 79 of file IOS_Streaming_BrowserViewController.h.
- (AVAssetWriter*) assetWriter [protected] |
Object to write media data to a new file
Definition at line 38 of file IOS_Streaming_BrowserViewController.h.
- (AVAssetWriterInput*) assetWriterInput [protected] |
Used to append media samples packaged as CMSampleBuffer objects, or collections of metadata, to a single track of the output file of an AVAssetWriter object.
Definition at line 43 of file IOS_Streaming_BrowserViewController.h.
- (AVAssetWriterInputPixelBufferAdaptor*) assetWriterPixelBufferAdaptor [protected] |
Used to append video samples packaged as CVPixelBuffer objects to a single AVAssetWriterInput object.
Definition at line 48 of file IOS_Streaming_BrowserViewController.h.
- (NSTimer*) assetWriterTimer [protected] |
Creates the assetWrite timer
Definition at line 28 of file IOS_Streaming_BrowserViewController.h.
- (NSTimer*) clockTimer [protected] |
Creates timer objects
Definition at line 23 of file IOS_Streaming_BrowserViewController.h.
- (IBOutlet UILabel*) displayInfo [protected] |
The ip address and port of the http server which is displayed on the view of the xib file
Definition at line 74 of file IOS_Streaming_BrowserViewController.h.
- (CFAbsoluteTime) firstFrameWallClockTime [protected] |
Used to represent a specific point in time relative to the absolute reference date of 1 Jan 2001 00:00:00 GMT.
Definition at line 54 of file IOS_Streaming_BrowserViewController.h.
- (HTTPServer*) httpServer [protected] |
Definition at line 84 of file IOS_Streaming_BrowserViewController.h.
- (AVMutableComposition*) mutableComposition [protected] |
Mutable data from mutiple files
Definition at line 33 of file IOS_Streaming_BrowserViewController.h.
- (IBOutlet UIWebView*) webView [protected] |
The web view on the xib file
Definition at line 59 of file IOS_Streaming_BrowserViewController.h.
- (UIActivityIndicatorView*) activityIndicator [read, write, retain] |
Definition at line 93 of file IOS_Streaming_BrowserViewController.h.
- (UITextField*) addressBar [read, write, retain] |
Definition at line 92 of file IOS_Streaming_BrowserViewController.h.
- (IBOutlet UIButton*) startStopButton [read, write, retain] |
Definition at line 90 of file IOS_Streaming_BrowserViewController.h.
- (UIWebView*) webView [read, write, retain] |
Definition at line 91 of file IOS_Streaming_BrowserViewController.h.