what’s new for windows 8 devs part 3 lewis benge devices & integration team tbwa\digital arts...

Download What’s new for Windows 8 Devs Part 3 Lewis Benge Devices & Integration Team TBWA\Digital Arts Network DEV216

If you can't read please download the document

Upload: ashlynn-ellis

Post on 26-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • Whats new for Windows 8 Devs Part 3 Lewis Benge Devices & Integration Team TBWA\Digital Arts Network DEV216
  • Slide 2
  • Slide 3
  • Slide 4
  • Camera
  • Slide 5
  • Slide 6
  • Snap a picture, record video and audio. Capture Windows.Media. Input and output audio devices such as Bluetooth. Devices Work with audio playlists. Playlists Stream media to a television or audio system. PlayTo Use PlayReady or other content protection systems. Protection Convert music or video to other formats or resolutions, trim, or make effects permanent. Transcoding Insert or remove well-known video effects. VideoEffects CameraCaptureUI MediaCapture Camera Capture UI Similar to pick photos or videos from the file system Built-in camera control with pre-defined user workflow Media Capture API You control every pixel on screen Custom User Experience and workflow
  • Slide 7
  • You control every pixel on screen Custom User Experience and workflow Enumerate cameras Support various formats: MP4, WMV, M4A, MP3, WMA (Additional formats possible through extensions) Allow various encoding settings Media Capture Built-in camera control with pre-defined user workflow Similar to pick photos or videos from the file system Specify quality of capture Set Timers Adjust settings, including IHV settings CameraCaptureUI
  • Slide 8
  • demo
  • Slide 9
  • Accessing Camera and Mic from your app // Application manifest capabilities required to access camera and microphone
  • Slide 10
  • Using the camera to snap a photo (JS) // Step 1: Invoke the camera capture UI for snapping a photo var captureUI = new Windows.Media.Capture.CameraCaptureUI(); captureUI.captureFileAsync(Windows.Media.CameraCaptureUI.Mode.photo). then(function(capturedItem) { if (capturedItem) { // Step 2: Display the photo document.getElementById(imagedisplay).src = URL.createObjectURL(capturedItem); } else { document.getElementById(message).innerHTML = User didnt capture a photo; } });
  • Slide 11
  • Using the camera to record a video (JS) // Step 1: Invoke the camera capture UI for record a video var captureUI = new Windows.Media.Capture.CameraCaptureUI(); captureUI.captureFileAsync(Windows.Media.CameraCaptureUI.Mode.video). then(function(capturedItem) { if (capturedItem) { // Step 2: Display the video document.getElementById(videoplayback).src = URL.createObjectURL(capturedItem); } });
  • Slide 12
  • demo
  • Slide 13
  • Starting preview on a function initializeMediaCapture() { // Step 1: create Media Capture object var mediaCaptureMgr = new Windows.Media.Capture.MediaCapture(); mediaCaptureMgr.initializeAsync().then( function (op) { // Step 2: Update the source of document.getElementById(preview").src = URL.createObjectURL(mediaCaptureMgr, false); // Step 3: Start displaying the camera feed document.getElementById(preview").play(); }); }
  • Slide 14
  • Recording a video Windows.Storage.KnownFolders.videosLibrary.createFileAsync("cameraCapture.mp4", Windows.Storage.CreationCollisionOption.generateUniqueName).then(function (newFile) { storageFile = newFile; encodingProfile= Windows.Media.MediaProperties.MediaEncodingProfile.createMp4( Windows.Media.MediaProperties.VideoEncodingQuality.auto); mediaCaptureMgr.startRecordToStorageFileAsync(encodingProfile, storageFile).then( function (result) { // recording, eventually stop it. // mediaCaptureMgr.stopRecordAsync(); }, errorHandler); }, errorHandler);
  • Slide 15
  • Capture Audio Windows.Storage.KnownFolders.videosLibrary.createFileAsync("cameraCapture.m4a", Windows.Storage.CreationCollisionOption.generateUniqueName).then(function (newFile) { storageFile = newFile; encodingProfile = Windows.Media.MediaProperties.MediaEncodingProfile.createM4a( Windows.Media.MediaProperties.AudioEncodingQuality.auto); mediaCaptureMgr.startRecordToStorageFileAsync(encodingProfile, storageFile).then( function (result) { //recording, eventually stop it.. mediaCaptureMgr.stopRecordAsync(); }, errorHandler); }, errorHandler);
  • Slide 16
  • Ambient Light Sensor Motion Sensor Fusion (Accelerometer, Magnetometer, Gyroscope) Windows Location Provider GPS (If mobile broadband hardware is present) Tablet and convertible standard equipment:
  • Slide 17
  • Location
  • Slide 18
  • Slide 19
  • Declare the need for Geolocation // Application manifest capabilities required // to access Geolocation in your app
  • Slide 20
  • GeoLocation using Windows API var loc; loc = new Windows.Devices.Geolocation.Geolocator(); //One-time loc.getGeopositionAsync().then(getPositionHandler); loc.addEventListener("positionchanged", function () { getPositionHandler ( args.position);}); function getPositionHandler(pos) { var lat = pos.coordinate.latitude; var long = pos.coordinate.longitude; var acc = pos.coordinate.accuracy; }
  • Slide 21
  • demo
  • Slide 22
  • Sensors
  • Slide 23
  • Slide 24
  • ShakeRotateFlip
  • Slide 25
  • DarkIndoorsOutdoors
  • Slide 26
  • Simple Data Simple Device Orientation Sensor Fusion Data Compass Inclinometer Device Orientation Light Sensor Accelerometer Raw Sensor Data Gyro
  • Slide 27
  • Accelerometer Sample Code var accelerometer; accelerometer = Windows.Devices.Sensors.Accelerometer.getDefault(); accelerometer.addEventListener("readingchanged",onAccReadingChanged); function onAccReadingChanged(e) { var accelX = e.reading.accelerationX; var accelY = e.reading.accelerationY; var accelZ = e.reading.accelerationZ; }
  • Slide 28
  • Slide 29
  • 3D Accelerometer 3D Gyro 3D Magnetometer Pass-Through Accelerometer Gyro Sensor Fusion Compass Inclinometer Device Orientation
  • Slide 30
  • ST Microelectronics eMotion Development Board
  • Slide 31
  • Slide 32
  • NFC
  • Slide 33
  • Windows.Networking. BackgroundTransfer Retrieves connection profiles (mobile broadband) Connectivity Mobile broadband account managementNetworkOperations Proximity devices in close range Proximity Encapsulates push notificationPushNotifcations Native web and TCP/UDP socket support Sockets Enables advance download and upload transfer
  • Slide 34
  • Determine when an NFC device enters (JS) function initializeProximityDevice() { var proximityDevice = Windows.Networking.Proximity.ProximityDevice.getDefault(); proximityDevice.addEventListener("devicearrived", proximityDeviceArrived); proximityDevice.addEventListener("devicedeparted", proximityDeviceDeparted); } function proximityDeviceArrived() { id("messageDiv").innerHTML += "Proximate device arrived. id = " + device.deviceId + " "; } function proximityDeviceDeparted() { id("messageDiv").innerHTML += "Proximate device departed. id = " + device.deviceId + " "; }
  • Slide 35
  • demo
  • Slide 36
  • Touch
  • Slide 37
  • Slide 38
  • Press and hold to learn Tap for primary actionSlide to dragSwipe to select Pinch to zoom Swipe from edge for app and system UI Rotate to rotate
  • Slide 39
  • Code for touch, get mouse and pen for free!
  • Slide 40
  • Slide 41
  • Slide 42
  • API surfaceCSS PropertiesDOM AttributesDOM Events Scrolling overflow -ms-scroll-rails -ms-scroll-snap-x -ms-scroll-snap-y -ms-scroll-chaining -ms-scroll-boundary scrollLeft scrollTop scroll Zooming -ms-content-zooming -ms-content-zoom- boundary -ms-content-zoom-snap msContentZoomFactorMSContentZoom BothMSManipulationStateChanged Snap-points -ms-scroll-snap-type -ms-scroll-snap-point-x
  • Slide 43
  • Slide 44
  • Slide 45
  • Other devices
  • Slide 46
  • Enumeration Windows.Devices. Geolocation Provides support for identifying the input devices. Input Identifies Windows Portable Device (WPF) services Portable Print task configuration and print notifications Printers Access to supported sensors and motion data Sensors Ability to send, receive, and delete SMS messages. Sms Enables app developers to easily access the computers geographic location. Device discover and notifications about devices.
  • Slide 47
  • Slide 48
  • Hardware recap
  • Slide 49
  • Slide 50