src/windows/CameraProxy.js
function orientationToRotation (orientation) {
        // VideoRotation enumerable and BitmapRotation enumerable have the same values
        // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.videorotation.aspx
        // https://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.imaging.bitmaprotation.aspx

        switch (orientation) {
        // portrait
        case Windows.Devices.Sensors.SimpleOrientation.notRotated:
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        // landscape
        case Windows.Devices.Sensors.SimpleOrientation.rotated90DegreesCounterclockwise:
            return Windows.Media.Capture.VideoRotation.none;
        // portrait-flipped (not supported by WinPhone Apps)
        case Windows.Devices.Sensors.SimpleOrientation.rotated180DegreesCounterclockwise:
            // Falling back to portrait default
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        // landscape-flipped
        case Windows.Devices.Sensors.SimpleOrientation.rotated270DegreesCounterclockwise:
            return Windows.Media.Capture.VideoRotation.clockwise180Degrees;
        // faceup & facedown
        default:
            // Falling back to portrait default
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        }
    }
function orientationToRotation (orientation) {
        // VideoRotation enumerable and BitmapRotation enumerable have the same values
        // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.videorotation.aspx
        // https://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.imaging.bitmaprotation.aspx

        switch (orientation) {
        // portrait
        case Windows.Devices.Sensors.SimpleOrientation.notRotated:
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        // landscape
        case Windows.Devices.Sensors.SimpleOrientation.rotated90DegreesCounterclockwise:
            return Windows.Media.Capture.VideoRotation.none;
        // portrait-flipped (not supported by WinPhone Apps)
        case Windows.Devices.Sensors.SimpleOrientation.rotated180DegreesCounterclockwise:
            // Falling back to portrait default
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        // landscape-flipped
        case Windows.Devices.Sensors.SimpleOrientation.rotated270DegreesCounterclockwise:
            return Windows.Media.Capture.VideoRotation.clockwise180Degrees;
        // faceup & facedown
        default:
            // Falling back to portrait default
            return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
        }
    }
function orientationToRotation ( orientation ) { // VideoRotation enumerable and BitmapRotation enumerable have the same values // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.videorotation.aspx // https://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.imaging.bitmaprotation.aspx switch ( orientation ) { // portrait case Windows . Devices . Sensors . SimpleOrientation . notRotated : return Windows . Media . Capture . VideoRotation . clockwise90Degrees ; // landscape case Windows . Devices . Sensors . SimpleOrientation . rotated90DegreesCounterclockwise : return Windows . Media . Capture . VideoRotation . none ; // portrait-flipped (not supported by WinPhone Apps) case Windows . Devices . Sensors . SimpleOrientation . rotated180DegreesCounterclockwise : // Falling back to portrait default return Windows . Media . Capture . VideoRotation . clockwise90Degrees ; // landscape-flipped case Windows . Devices . Sensors . SimpleOrientation . rotated270DegreesCounterclockwise : return Windows . Media . Capture . VideoRotation . clockwise180Degrees ; // faceup & facedown default : // Falling back to portrait default return Windows . Media . Capture . VideoRotation . clockwise90Degrees ; } }
Converts SimpleOrientation to a VideoRotation to remove difference between camera sensor orientation
and video orientation
@param  {number} orientation - Windows.Devices.Sensors.SimpleOrientation
@return {number} - Windows.Media.Capture.VideoRotation
Converts SimpleOrientation to a VideoRotation to remove difference between camera sensor orientation and video orientation