OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // To open another video on existing ContentVideoView. | 34 // To open another video on existing ContentVideoView. |
35 void OpenVideo(); | 35 void OpenVideo(); |
36 | 36 |
37 static bool RegisterContentVideoView(JNIEnv* env); | 37 static bool RegisterContentVideoView(JNIEnv* env); |
38 static void KeepScreenOn(bool screen_on); | 38 static void KeepScreenOn(bool screen_on); |
39 | 39 |
40 // Return the singleton object or NULL. | 40 // Return the singleton object or NULL. |
41 static ContentVideoView* GetInstance(); | 41 static ContentVideoView* GetInstance(); |
42 | 42 |
43 // Getter method called by the Java class to get the media information. | 43 // Getter method called by the Java class to get the media information. |
44 int GetVideoWidth(JNIEnv*, jobject obj) const; | |
45 int GetVideoHeight(JNIEnv*, jobject obj) const; | |
46 int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; | |
47 int GetCurrentPosition(JNIEnv*, jobject obj) const; | |
48 bool IsPlaying(JNIEnv*, jobject obj); | 44 bool IsPlaying(JNIEnv*, jobject obj); |
49 void RequestMediaMetadata(JNIEnv*, jobject obj); | 45 void RequestMediaMetadata(JNIEnv*, jobject obj); |
50 | 46 |
51 // Called when the Java fullscreen view is destroyed. If | 47 // Called when the Java fullscreen view is destroyed. If |
52 // |release_media_player| is true, |manager_| needs to release the player | 48 // |release_media_player| is true, |manager_| needs to release the player |
53 // as we are quitting the app. | 49 // as we are quitting the app. |
54 void ExitFullscreen(JNIEnv*, jobject, jboolean release_media_player); | 50 void ExitFullscreen(JNIEnv*, jobject, jboolean release_media_player); |
55 | 51 |
56 // Media control method called by the Java class. | |
57 void SeekTo(JNIEnv*, jobject obj, jint msec); | |
58 void Play(JNIEnv*, jobject obj); | |
59 void Pause(JNIEnv*, jobject obj); | |
60 | |
61 // Called by the Java class to pass the surface object to the player. | 52 // Called by the Java class to pass the surface object to the player. |
62 void SetSurface(JNIEnv*, jobject obj, jobject surface); | 53 void SetSurface(JNIEnv*, jobject obj, jobject surface); |
63 | 54 |
64 // Method called by |manager_| to inform the Java class about player status | 55 // Method called by |manager_| to inform the Java class about player status |
65 // change. | 56 // change. |
66 void UpdateMediaMetadata(); | 57 void UpdateMediaMetadata(); |
67 void OnMediaPlayerError(int errorType); | 58 void OnMediaPlayerError(int errorType); |
68 void OnVideoSizeChanged(int width, int height); | 59 void OnVideoSizeChanged(int width, int height); |
69 void OnBufferingUpdate(int percent); | 60 void OnBufferingUpdate(int percent); |
70 void OnPlaybackComplete(); | 61 void OnPlaybackComplete(); |
(...skipping 23 matching lines...) Expand all Loading... |
94 | 85 |
95 // Weak pointer for posting tasks. | 86 // Weak pointer for posting tasks. |
96 base::WeakPtrFactory<ContentVideoView> weak_factory_; | 87 base::WeakPtrFactory<ContentVideoView> weak_factory_; |
97 | 88 |
98 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); | 89 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
99 }; | 90 }; |
100 | 91 |
101 } // namespace content | 92 } // namespace content |
102 | 93 |
103 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 94 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
OLD | NEW |