OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 private: | 131 private: |
132 MediaLoadedEventListener() : EventListener(CPPEventListenerType) {} | 132 MediaLoadedEventListener() : EventListener(CPPEventListenerType) {} |
133 | 133 |
134 void handleEvent(ExecutionContext* context, Event* event) override { | 134 void handleEvent(ExecutionContext* context, Event* event) override { |
135 HTMLVideoElement* media = | 135 HTMLVideoElement* media = |
136 static_cast<HTMLVideoElement*>(event->target()->toNode()); | 136 static_cast<HTMLVideoElement*>(event->target()->toNode()); |
137 UserGestureIndicator gesture( | 137 UserGestureIndicator gesture( |
138 DocumentUserGestureToken::create(&media->document())); | 138 DocumentUserGestureToken::create(&media->document())); |
139 media->webkitEnterFullscreen(); | 139 // TODO(shaktisahu): Enable fullscreen after https://crbug/698353 is fixed. |
140 media->play(); | 140 media->play(); |
141 } | 141 } |
142 }; | 142 }; |
143 | 143 |
144 void MediaDocumentParser::createDocumentStructure() { | 144 void MediaDocumentParser::createDocumentStructure() { |
145 DCHECK(document()); | 145 DCHECK(document()); |
146 HTMLHtmlElement* rootElement = HTMLHtmlElement::create(*document()); | 146 HTMLHtmlElement* rootElement = HTMLHtmlElement::create(*document()); |
147 document()->appendChild(rootElement); | 147 document()->appendChild(rootElement); |
148 rootElement->insertedByParser(); | 148 rootElement->insertedByParser(); |
149 | 149 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if (keyboardEvent->key() == " " || | 292 if (keyboardEvent->key() == " " || |
293 keyboardEvent->keyCode() == VKEY_MEDIA_PLAY_PAUSE) { | 293 keyboardEvent->keyCode() == VKEY_MEDIA_PLAY_PAUSE) { |
294 // space or media key (play/pause) | 294 // space or media key (play/pause) |
295 video->togglePlayState(); | 295 video->togglePlayState(); |
296 event->setDefaultHandled(); | 296 event->setDefaultHandled(); |
297 } | 297 } |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 } // namespace blink | 301 } // namespace blink |
OLD | NEW |