Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: Source/core/html/HTMLVideoElement.cpp

Issue 131763011: Expose the poster image URL to WebMediaPlayer subclasses (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address Aaron's final comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/platform/graphics/media/MediaPlayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 HTMLMediaElement::setDisplayMode(Unknown); 106 HTMLMediaElement::setDisplayMode(Unknown);
107 updateDisplayState(); 107 updateDisplayState();
108 if (shouldDisplayPosterImage()) { 108 if (shouldDisplayPosterImage()) {
109 if (!m_imageLoader) 109 if (!m_imageLoader)
110 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 110 m_imageLoader = adoptPtr(new HTMLImageLoader(this));
111 m_imageLoader->updateFromElementIgnoringPreviousError(); 111 m_imageLoader->updateFromElementIgnoringPreviousError();
112 } else { 112 } else {
113 if (renderer()) 113 if (renderer())
114 toRenderImage(renderer())->imageResource()->setImageResource(0); 114 toRenderImage(renderer())->imageResource()->setImageResource(0);
115 } 115 }
116 // Notify the player when the poster image URL changes.
117 if (player())
118 player()->setPoster(posterImageURL());
116 } else 119 } else
117 HTMLMediaElement::parseAttribute(name, value); 120 HTMLMediaElement::parseAttribute(name, value);
118 } 121 }
119 122
120 bool HTMLVideoElement::supportsFullscreen() const 123 bool HTMLVideoElement::supportsFullscreen() const
121 { 124 {
122 if (!document().page()) 125 if (!document().page())
123 return false; 126 return false;
124 127
125 if (!player()) 128 if (!player())
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 266 }
264 267
265 KURL HTMLVideoElement::posterImageURL() const 268 KURL HTMLVideoElement::posterImageURL() const
266 { 269 {
267 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); 270 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL());
268 if (url.isEmpty()) 271 if (url.isEmpty())
269 return KURL(); 272 return KURL();
270 return document().completeURL(url); 273 return document().completeURL(url);
271 } 274 }
272 275
276 KURL HTMLVideoElement::mediaPlayerPosterURL()
277 {
278 return posterImageURL();
273 } 279 }
280
281 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/platform/graphics/media/MediaPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698