| OLD | NEW |
| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 void HTMLVideoElement::setDisplayMode(DisplayMode mode) | 162 void HTMLVideoElement::setDisplayMode(DisplayMode mode) |
| 163 { | 163 { |
| 164 DisplayMode oldMode = displayMode(); | 164 DisplayMode oldMode = displayMode(); |
| 165 KURL poster = posterImageURL(); | 165 KURL poster = posterImageURL(); |
| 166 | 166 |
| 167 if (!poster.isEmpty()) { | 167 if (!poster.isEmpty()) { |
| 168 // We have a poster path, but only show it until the user triggers displ
ay by playing or seeking and the | 168 // We have a poster path, but only show it until the user triggers displ
ay by playing or seeking and the |
| 169 // media engine has something to display. | 169 // media engine has something to display. |
| 170 if (mode == Video && !hasAvailableVideoFrame()) | 170 // Don't show the poster if there is a seek operation or |
| 171 // the video has restarted because of loop attribute |
| 172 if (mode == Video && oldMode == Poster && !hasAvailableVideoFrame()) |
| 171 mode = PosterWaitingForVideo; | 173 mode = PosterWaitingForVideo; |
| 172 } | 174 } |
| 173 | 175 |
| 174 HTMLMediaElement::setDisplayMode(mode); | 176 HTMLMediaElement::setDisplayMode(mode); |
| 175 | 177 |
| 176 if (renderer() && displayMode() != oldMode) | 178 if (renderer() && displayMode() != oldMode) |
| 177 renderer()->updateFromElement(); | 179 renderer()->updateFromElement(); |
| 178 } | 180 } |
| 179 | 181 |
| 180 void HTMLVideoElement::updateDisplayState() | 182 void HTMLVideoElement::updateDisplayState() |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 { | 299 { |
| 298 return !hasSingleSecurityOrigin() || (!(player() && player()->didPassCORSAcc
essCheck()) && destinationSecurityOrigin->taintsCanvas(currentSrc())); | 300 return !hasSingleSecurityOrigin() || (!(player() && player()->didPassCORSAcc
essCheck()) && destinationSecurityOrigin->taintsCanvas(currentSrc())); |
| 299 } | 301 } |
| 300 | 302 |
| 301 FloatSize HTMLVideoElement::sourceSize() const | 303 FloatSize HTMLVideoElement::sourceSize() const |
| 302 { | 304 { |
| 303 return FloatSize(videoWidth(), videoHeight()); | 305 return FloatSize(videoWidth(), videoHeight()); |
| 304 } | 306 } |
| 305 | 307 |
| 306 } | 308 } |
| OLD | NEW |