Pepper_47_C++_interfaces
media_control_samsung.h
Go to the documentation of this file.
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_SAMSUNG_MEDIA_CONTROL_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_MEDIA_CONTROL_SAMSUNG_H_
7 
8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/resource.h"
10 #include "ppapi/cpp/var.h"
11 #include "ppapi/c/samsung/pp_media_control_samsung.h"
12 #include "ppapi/c/samsung/ppp_media_control_samsung.h"
13 
14 namespace pp {
15 
16 /// Interface allowing application to receive various events regarding
17 /// media playback stream/clip (i.e. player state changes, duration update,
18 /// media time position changes, media errors).
20  public:
21  /// Destructor
22  virtual ~MediaControl_Samsung();
23 
24  /// Method called when controller handling particular stream/clip finish
25  /// transition to PLAYING state.
26  ///
27  /// |timestamp| - current time of media
28  virtual void Play(PP_MicrosecondsDelta timestamp) = 0;
29 
30  /// Method called when controller handling particular stream finish
31  /// transition to PAUSED state.
32  virtual void Pause() = 0;
33 
34  /// Signals that end of stream has been reached, |error| argument of
35  /// PP_MediaError type signals if this is caused by some sort of error.
36  virtual void Ended(PP_MediaError error) = 0;
37 
38  /// Method called when played media playback time has been changed explicitly.
39  virtual void Seeking(PP_MicrosecondsDelta seekTime) = 0;
40 
41  /// Method called when played stream duration has been changed.
42  /// |duration| is total stream duration in microseconds.
43  virtual void DurationChange(PP_MicrosecondsDelta duration) = 0;
44 
45  /// Method called periodically in PLAYING to signal advance of media
46  /// playback time. Minimal resolution of callback is 0.5s.
47  /// |media_times| represents current media time in microseconds from beginning
48  /// of the stream/clip.
49  virtual void TimeUpdate(PP_MicrosecondsDelta media_time) = 0;
50 
51  /// Method called when media playback rate is changed.
52  virtual void RateChange(float playback_rate) = 0;
53 
54  protected:
55  // This object can't be directly created by app.
56  // Creates an is_null() MediaControl object.
58 };
59 
60 } // namespace pp
61 
62 #endif // PPAPI_CPP_SAMSUNG_MEDIA_CONTROL_SAMSUNG_H_
virtual void TimeUpdate(PP_MicrosecondsDelta media_time)=0
virtual void Play(PP_MicrosecondsDelta timestamp)=0
virtual ~MediaControl_Samsung()
Destructor.
virtual void RateChange(float playback_rate)=0
Method called when media playback rate is changed.
virtual void Seeking(PP_MicrosecondsDelta seekTime)=0
Method called when played media playback time has been changed explicitly.
virtual void DurationChange(PP_MicrosecondsDelta duration)=0
virtual void Pause()=0
virtual void Ended(PP_MediaError error)=0