Pepper_42_C++_interfaces
media_events_listener_samsung.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Samsung Electronics. 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_EVENTS_LISTENER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_MEDIA_EVENTS_LISTENER_SAMSUNG_H_
7 
8 #include "ppapi/c/pp_resource.h"
9 #include "ppapi/c/samsung/ppp_media_player_samsung.h"
10 
11 /// @file
12 /// This file defines a <code>MediaEventsListener_Samsung</code> type which
13 /// allows plugin to receive player or playback related events.
14 namespace pp {
15 
16 class MediaPlayer_Samsung;
17 
18 /// Listener for receiving player or playback related events.
20  public:
22 
23  /// Event sent periodically during clip playback and indicates playback
24  /// progress.
25  ///
26  /// Event will be sent at least twice per second.
27  ///
28  /// @param[in] time current media time.
29  virtual void OnTimeUpdate(PP_TimeTicks time);
30 
31  /// Played clip has ended.
32  virtual void OnEnded();
33 
34  /// Error during playback has occurred.
35  ///
36  /// @param[in] error An error code signalizing type of occurred error.
37  virtual void OnError(PP_MediaPlayerError error);
38 
39  protected:
40  /// The default constructor which creates listener not attached
41  /// to the player
43 
44  /// Constructor which creates listener attached to the |player|.
46 
47  /// Attaches listener to the |player|.
48  void AttachTo(MediaPlayer_Samsung* player);
49 
50  private:
51  void Detach();
52  PP_Resource player_;
53 
54  // Disallow copy and assign
57 };
58 
59 } // namespace pp
60 
61 #endif // PPAPI_CPP_SAMSUNG_MEDIA_EVENTS_LISTENER_SAMSUNG_H_
virtual void OnError(PP_MediaPlayerError error)
virtual void OnTimeUpdate(PP_TimeTicks time)
Listener for receiving player or playback related events.
void AttachTo(MediaPlayer_Samsung *player)
Attaches listener to the |player|.
virtual void OnEnded()
Played clip has ended.