1/* 2 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#ifndef MediaPlayerProxy_h 27#define MediaPlayerProxy_h 28 29OBJC_CLASS WebMediaPlayerProxy; 30 31enum MediaPlayerProxyNotificationType { 32 33 MediaPlayerNotificationMediaValidated = 1, 34 MediaPlayerNotificationMediaFailedToValidate, 35 36 MediaPlayerNotificationStartUsingNetwork, 37 MediaPlayerNotificationStopUsingNetwork, 38 39 MediaPlayerNotificationEnteredFullscreen, 40 MediaPlayerNotificationExitedFullscreen, 41 42 MediaPlayerNotificationReadyForInspection, 43 MediaPlayerNotificationReadyForPlayback, 44 MediaPlayerNotificationDidPlayToTheEnd, 45 46 MediaPlayerNotificationPlaybackFailed, 47 48 MediaPlayerNotificationStreamLikelyToKeepUp, 49 MediaPlayerNotificationStreamUnlikelyToKeepUp, 50 MediaPlayerNotificationStreamBufferFull, 51 MediaPlayerNotificationStreamRanDry, 52 MediaPlayerNotificationFileLoaded, 53 54 MediaPlayerNotificationSizeDidChange, 55 MediaPlayerNotificationVolumeDidChange, 56 MediaPlayerNotificationMutedDidChange, 57 MediaPlayerNotificationTimeJumped, 58 59 MediaPlayerNotificationPlayPauseButtonPressed, 60}; 61 62#ifdef __OBJC__ 63@interface NSObject (WebMediaPlayerProxy) 64 65- (int)_interfaceVersion; 66 67- (void)_disconnect; 68 69- (void)_load:(NSURL *)url; 70- (void)_cancelLoad; 71 72- (void)_setPoster:(NSURL *)url; 73 74- (void)_play; 75- (void)_pause; 76 77- (NSSize)_naturalSize; 78 79- (BOOL)_hasVideo; 80- (BOOL)_hasAudio; 81 82- (NSTimeInterval)_duration; 83 84- (double)_currentTime; 85- (void)_setCurrentTime:(double)time; 86- (BOOL)_seeking; 87 88- (void)_setEndTime:(double)time; 89 90- (float)_rate; 91- (void)_setRate:(float)rate; 92 93- (float)_volume; 94- (void)_setVolume:(float)newVolume; 95 96- (BOOL)_muted; 97- (void)_setMuted:(BOOL)muted; 98 99- (float)_maxTimeBuffered; 100- (float)_maxTimeSeekable; 101- (NSArray *)_bufferedTimeRanges; 102 103- (int)_dataRate; 104 105- (BOOL)_totalBytesKnown; 106- (unsigned)_totalBytes; 107- (unsigned)_bytesLoaded; 108 109- (NSArray *)_mimeTypes; 110 111@end 112#endif 113 114#endif 115