Skip to:
Content

BuddyPress.org

Changeset 9860


Ignore:
Timestamp:
05/10/2015 12:24:24 PM (10 years ago)
Author:
imath
Message:

Avatar UI : improve the camera feature

  • Change the name of the tab: "Camera" is now replaced by "Take Photo"
  • Improve the user feedback messages
  • Completely disable the feature for Internet Explorer and Safari as they do not support getUserMedia.

Props r-a-y, boonebgorges.

Fixes #6425

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r9827 r9860  
    224224        // Create the Camera Nav if the WebCam capture feature is enabled
    225225        if ( bp_avatar_use_webcam() && 'user' === $object ) {
    226             $avatar_nav['camera'] = array( 'id' => 'camera', 'caption' => __( 'Camera', 'buddypress' ), 'order' => 10 );
     226            $avatar_nav['camera'] = array( 'id' => 'camera', 'caption' => __( 'Take Photo', 'buddypress' ), 'order' => 10 );
    227227
    228228            // Set warning messages
    229229            $strings['camera_warnings'] = array(
    230                 'requesting'  => __( 'Requesting video stream, please authorize this website to access to your camera.', 'buddypress'),
    231                 'loading'     => __( 'Please wait for the video to load.', 'buddypress' ),
    232                 'loaded'      => __( 'Video stream loaded. You can use the capture button to display the profile photo preview.', 'buddypress' ),
    233                 'noaccess'    => __( 'You denied this website to access to your camera. Please use the upload form.', 'buddypress' ),
    234                 'errormsg'    => __( 'Your browser is not supported. Please use the upload form.', 'buddypress' ),
    235                 'videoerror'  => __( 'Video error. Please use the upload form.', 'buddypress' ),
    236                 'ready'       => __( 'Your profile photo is ready, use the save button to validate.', 'buddypress' ),
    237                 'nocapture'   => __( 'No profile photo was captured, please use the capture button first.', 'buddypress' ),
     230                'requesting'  => __( 'Please allow us to access to your camera.', 'buddypress'),
     231                'loading'     => __( 'Please wait as we access your camera.', 'buddypress' ),
     232                'loaded'      => __( 'Camera loaded. Click on the "Capture" button to take your photo.', 'buddypress' ),
     233                'noaccess'    => __( 'It looks like you do not have a webcam or we were unable to get permission to use your webcam. Please upload a photo instead.', 'buddypress' ),
     234                'errormsg'    => __( 'Your browser is not supported. Please upload a photo instead.', 'buddypress' ),
     235                'videoerror'  => __( 'Video error. Please upload a photo instead.', 'buddypress' ),
     236                'ready'       => __( 'Your profile photo is ready. Click on the "Save" button to use this photo.', 'buddypress' ),
     237                'nocapture'   => __( 'No photo was captured. Click on the "Capture" button to take your photo.', 'buddypress' ),
    238238            );
    239239        }
  • trunk/src/bp-core/bp-core-avatars.php

    r9828 r9860  
    18391839 * @since  BuddyPress (2.3.0)
    18401840 *
     1841 * @global $is_safari
     1842 * @global $is_IE
    18411843 * @return bool True to load the Webcam Avatar UI part. False otherwise.
    18421844 */
    18431845function bp_avatar_use_webcam() {
     1846    global $is_safari, $is_IE;
     1847
    18441848    /**
    18451849     * Do not use the webcam feature for mobile devices
     
    18471851     */
    18481852    if ( wp_is_mobile() ) {
     1853        return false;
     1854    }
     1855
     1856    /**
     1857     * Bail when the browser does not support getUserMedia.
     1858     *
     1859     * @see  http://caniuse.com/#feat=stream
     1860     */
     1861    if ( $is_safari || $is_IE ) {
    18491862        return false;
    18501863    }
  • trunk/src/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php

    r9819 r9860  
    1414    <# if ( ! data.user_media ) { #>
    1515        <div id="bp-webcam-message">
    16             <p class="warning"><?php esc_html_e( 'Your browser does not support the camera feature', 'buddypress' );?></p>
     16            <p class="warning"><?php esc_html_e( 'Your browser does not support this feature.', 'buddypress' );?></p>
    1717        </div>
    1818    <# } else { #>
Note: See TracChangeset for help on using the changeset viewer.