summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webmediaplayer_delegate_impl.cc
blob: f0aafd1056d67e70a870ff0dd91e49731a3a091b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright (c) 2008 The Chromium Authors. All rights reserved.  Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.

#include "chrome/renderer/webmediaplayer_delegate_impl.h"

WebMediaPlayerDelegateImpl::WebMediaPlayerDelegateImpl()
    : bytes_loaded_(0),
      current_time_(0.0f),
      data_rate_(0),
      duration_(0.0f),
      height_(0),
      network_state_(webkit_glue::WebMediaPlayer::EMPTY),
      paused_(true),
      playback_rate_(0.0f),
      ready_state_(webkit_glue::WebMediaPlayer::DATA_UNAVAILABLE),
      seeking_(false),
      total_bytes_(0),
      video_(false),
      visible_(false),
      volume_(0.0f),
      web_media_player_(NULL),
      width_(0) {
  // TODO(hclam): initialize the media player here
}

WebMediaPlayerDelegateImpl::~WebMediaPlayerDelegateImpl() {
  // TODO(hclam): do the following things here:
  // 1. Destroy the internal media player
  // 2. Destroy the associated WebMediaPlayer
}

void WebMediaPlayerDelegateImpl::Initialize(
    webkit_glue::WebMediaPlayer* media_player) {
  web_media_player_ = media_player;
}

void WebMediaPlayerDelegateImpl::Load(const GURL& url) {
}

void WebMediaPlayerDelegateImpl::CancelLoad() {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::Play() {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::Pause() {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::Stop() {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::Seek(float time) {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::SetEndTime(float time) {
  // TODO(hclam): delegate to google's media player
}
 
void WebMediaPlayerDelegateImpl::SetPlaybackRate(float rate) {
  // TODO(hclam): delegate to google's media player
}

void WebMediaPlayerDelegateImpl::SetVolume(float volume) {
  // TODO(hclam): delegate to google's media player
}
 
void WebMediaPlayerDelegateImpl::SetVisible(bool visible) {
  // TODO(hclam): delegate to google's media player
}
 
bool WebMediaPlayerDelegateImpl::IsTotalBytesKnown() {
  // TODO(hclam): delegate to google's media player
  return false;
}

float WebMediaPlayerDelegateImpl::GetMaxTimeBuffered() const {
  // TODO(hclam): delegate to google's media player
  return 0.0f;
}

float WebMediaPlayerDelegateImpl::GetMaxTimeSeekable() const {
  // TODO(hclam): delegate to google's media player
  return 0.0f;
}

void WebMediaPlayerDelegateImpl::SetRect(const gfx::Rect& rect) {
  // TODO(hclam): Figure out what to do here..
}

void WebMediaPlayerDelegateImpl::Paint(skia::PlatformCanvas *canvas,
                                       const gfx::Rect& rect) {
  // TODO(hclam): grab a frame from the internal player and draw it.
}

void WebMediaPlayerDelegateImpl::WillSendRequest(WebRequest& request,
                                                 const WebResponse& response) {
  // TODO(hclam): do we need to change the request?
}

void WebMediaPlayerDelegateImpl::DidReceiveResponse(
    const WebResponse& response) {
  // TODO(hclam): tell the video piepline to prepare for arriving bytes.
}

void WebMediaPlayerDelegateImpl::DidReceiveData(const char* buf, size_t size) {
  // TODO(hclam): direct the data to video pipeline's data source
}

void WebMediaPlayerDelegateImpl::DidFinishLoading() {
  // TODO(hclam): do appropriate actions related to load. We should wait
  // for video pipeline to be initialized and fire a LOADED event.
}

void WebMediaPlayerDelegateImpl::DidFail(const WebError& error) {
  // Simply fires a LOAD_FAILED event.
  // TODO(hclam): will also need to fire a MediaError event.
}