00001 // 00002 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 00003 // and associated documentation files (the "Software"), to deal in the Software without restriction, 00004 // including without limitation the rights to use, copy, modify, merge, publish, distribute, 00005 // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 00006 // furnished to do so, subject to the following conditions: 00007 // 00008 // 1. The permission granted herein does not extend to commercial use of the Software by entities 00009 // primarily engaged in providing online video and related services; and 00010 // 00011 // 2. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 00012 // BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00013 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00014 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00015 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00016 // 00017 00088 #import <Foundation/Foundation.h> 00089 #import <MediaPlayer/MediaPlayer.h> 00090 00091 @class BCVideo; 00092 00093 @interface BCMoviePlayerController : MPMoviePlayerController <MPMediaPlayback> { 00094 BCVideo *bcVideo; 00095 int renditionLowBitRate; 00096 int renditionHighBitRate; 00097 BOOL shouldLog; 00098 BOOL isThreeDotTwoOrGreater; 00099 BOOL initialized; 00100 BOOL sortHTTPStreamingPlaylistForWIFI; 00101 } 00102 00103 - (id)initWithContentURL:(BCVideo *)video searchForRenditionWithLowBitRate:(NSNumber *)lowBitRate andHighBitRate:(NSNumber *)highBitRate; 00104 - (void)setContentURL:(BCVideo *)video; 00105 - (void)searchForRenditionsBetweenLowBitRate:(NSNumber *)lowBitRate andHighBitRate:(NSNumber *)highBitRate; 00106 00113 @property(nonatomic, assign) BOOL sortHTTPStreamingPlaylistForWIFI; 00114 00115 #pragma mark - 00116 #pragma mark Apple MPMediaPlayback Protocal 00117 - (void)prepareToPlay; 00118 00119 // Returns YES if prepared for playback. 00120 @property(nonatomic, readonly) BOOL isPreparedToPlay; 00121 00122 // Plays items from the current queue, resuming paused playback if possible. 00123 - (void)play; 00124 00125 // Pauses playback if playing. 00126 - (void)pause; 00127 00128 // Ends playback. Calling -play again will start from the beginnning of the queue. 00129 - (void)stop; 00130 00131 // The current playback time of the now playing item in seconds. 00132 @property(nonatomic) NSTimeInterval currentPlaybackTime; 00133 00134 // The current playback rate of the now playing item. Default is 1.0 (normal speed). 00135 // Pausing will set the rate to 0.0. Setting the rate to non-zero implies playing. 00136 @property(nonatomic) float currentPlaybackRate; 00137 00138 // The seeking rate will increase the longer scanning is active. 00139 - (void)beginSeekingForward; 00140 - (void)beginSeekingBackward; 00141 - (void)endSeeking; 00142 00143 @end