⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179689 in webkit


Ignore:
Timestamp:
Feb 5, 2015, 5:34:41 AM (12 years ago)
Author:
dino@apple.com
Message:

[Media iOS] Add a debug setting to always show the optimized fullscreen button
​https://bugs.webkit.org/show_bug.cgi?id=141277
<rdar://problem/19724471>

Reviewed by Eric Carlson.

Add a debug option so that we can test the optimized fullscreen
control on media that doesn't support it.

  • Modules/mediacontrols/mediaControlsiOS.js: Add gSimulateOptimizedFullscreenAvailable.

(ControllerIOS.prototype.createControls): Check the setting.
(ControllerIOS.prototype.configureInlineControls): Ditto.
(ControllerIOS.prototype.formatTime): Drive-by whitespace cleanup.
(ControllerIOS.prototype.handleBaseGestureChange):
(ControllerIOS.prototype.handleWrapperTouchStart):
(ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd):
(ControllerIOS.prototype.handlePresentationModeChange): Drive-by variable renaming.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r179687 r179689  
     12015-02-04  Dean Jackson  <dino@apple.com>
     2
     3        [Media iOS] Add a debug setting to always show the optimized fullscreen button
     4        https://bugs.webkit.org/show_bug.cgi?id=141277
     5        <rdar://problem/19724471>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Add a debug option so that we can test the optimized fullscreen
     10        control on media that doesn't support it.
     11
     12        * Modules/mediacontrols/mediaControlsiOS.js: Add gSimulateOptimizedFullscreenAvailable.
     13        (ControllerIOS.prototype.createControls): Check the setting.
     14        (ControllerIOS.prototype.configureInlineControls): Ditto.
     15        (ControllerIOS.prototype.formatTime): Drive-by whitespace cleanup.
     16        (ControllerIOS.prototype.handleBaseGestureChange):
     17        (ControllerIOS.prototype.handleWrapperTouchStart):
     18        (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd):
     19        (ControllerIOS.prototype.handlePresentationModeChange): Drive-by variable renaming.
     20
    1212015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
    222
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r179612 r179689  
    2626ControllerIOS.gWirelessImage = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 245"><g fill="#1060FE"><path d="M193.6,6.3v121.6H6.4V6.3H193.6 M199.1,0.7H0.9v132.7h198.2V0.7L199.1,0.7z"/><path d="M43.5,139.3c15.8,8,35.3,12.7,56.5,12.7s40.7-4.7,56.5-12.7H43.5z"/></g><g text-anchor="middle" font-family="Helvetica Neue"><text x="100" y="204" fill="white" font-size="24">##DEVICE_TYPE##</text><text x="100" y="234" fill="#5C5C5C" font-size="21">##DEVICE_NAME##</text></g></svg>';
    2727ControllerIOS.gSimulateWirelessPlaybackTarget = false; // Used for testing when there are no wireless targets.
     28ControllerIOS.gSimulateOptimizedFullscreenAvailable = false; // Used for testing when optimized fullscreen is not available.
    2829
    2930ControllerIOS.prototype = {
    … …  
    151152        var inlinePlaybackPlaceholder = this.controls.inlinePlaybackPlaceholder = document.createElement('div');
    152153        inlinePlaybackPlaceholder.setAttribute('pseudo', '-webkit-media-controls-inline-playback-placeholder');
    153         inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
     154        if (!ControllerIOS.gSimulateOptimizedFullscreenAvailable)
     155            inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
    154156        inlinePlaybackPlaceholder.setAttribute('aria-label', this.UIString('Display Optimized Full Screen'));
    155157
    … …  
    224226        }
    225227        if (!this.isAudio()) {
    226             if ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('optimized'))
     228            if (ControllerIOS.gSimulateOptimizedFullscreenAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('optimized')))
    227229                this.controls.panel.appendChild(this.controls.optimizedFullscreenButton);
    228230            this.controls.panel.appendChild(this.controls.fullscreenButton);
    … …  
    343345        if (!this.video.controls || this.isAudio() || this.isFullScreen() || this.gestureStartTime === undefined || this.controlsType == ControllerIOS.StartPlaybackControls)
    344346            return;
    345        
     347
    346348        var scaleDetectionThreshold = 0.2;
    347349        if (event.scale > 1 + scaleDetectionThreshold || event.scale < 1 - scaleDetectionThreshold)
    … …  
    357359
    358360        var velocity = Math.abs(event.scale - 1) / duration;
    359        
     361
    360362        var pinchOutVelocityThreshold = 2;
    361363        var pinchOutGestureScaleThreshold = 1.25;
    … …  
    376378
    377379        this.mostRecentNumberOfTargettedTouches = event.targetTouches.length;
    378        
     380
    379381        if (this.controlsAreHidden()) {
    380382            this.showControls();
    … …  
    459461            this.video.webkitSetPresentationMode('optimized');
    460462    },
    461        
     463
    462464    handleOptimizedFullscreenTouchStart: function() {
    463465        this.controls.optimizedFullscreenButton.classList.add('active');
    464466    },
    465        
     467
    466468    handleOptimizedFullscreenTouchEnd: function(event) {
    467469        this.controls.optimizedFullscreenButton.classList.remove('active');
    468        
     470
    469471        this.handleOptimizedFullscreenButtonClicked();
    470        
    471         return true;
    472     },
    473        
     472
     473        return true;
     474    },
     475
    474476    handleOptimizedFullscreenTouchCancel: function(event) {
    475477        this.controls.optimizedFullscreenButton.classList.remove('active');
    … …  
    613615                break;
    614616            case 'optimized':
    615                 var backgroundImageSVG = "url('" + this.host.mediaUIImageData("optimized-fullscreen-placeholder") + "')";
    616                 this.controls.inlinePlaybackPlaceholder.style.backgroundImage = backgroundImageSVG;
     617                var backgroundImage = "url('" + this.host.mediaUIImageData("optimized-fullscreen-placeholder") + "')";
     618                this.controls.inlinePlaybackPlaceholder.style.backgroundImage = backgroundImage;
    617619                this.controls.inlinePlaybackPlaceholder.setAttribute('aria-label', "video playback placeholder");
    618620                this.controls.inlinePlaybackPlaceholder.classList.remove(this.ClassNames.hidden);
Note: See TracChangeset for help on using the changeset viewer.