Your Metro style app, video and audio, Part 1

Slides:



Advertisements
Similar presentations
Multimedia Components (Develop & Delivery System)
Advertisements

FormatIEFirefoxOperaChromeSafari OggNo No MPEG 49.0+No WebMNo No FormatIE 9Firefox 3.5Opera 10.5 Chrome 3.0 Safari.
What is HTML5…?. ”…removes the need for plugins” ”…can handle multimedia directly” ”…enables rich, interactive clients” ”…enables advanced visual designs”
Bring Life to Your Web Pages with JavaScript and HTML5 Part 2 Ole Ildsgaard Hougaard -
1 HTML5 Audio and Video Credits: Dr. Jay Urbain
Media Transfer Protocol supported. 2 Session Outline Overview Overview Why use a class protocol? Why use a class protocol? Core scenarios & functionality.
TouchDevelop Chapter 5-7 Chapter 5 Audio Chapter 6 Camera, Graphics and Video Chapter 7 Sensors Mengfei Ren.
HTML5 Media API.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 17: Video, Audio, and Other MultiMedia.
Understanding Mobile App Development Concepts and Working with APIs Lesson 6.
Group 8: Dylan Lentini (AE), Mandy Minuti (WSE), Jean Paul Galea (TL)
Will Law | Chief Media Architect | Akamai Optimizing the Black Box of HTML.
HTML 5 and CSS 3, Illustrated Complete Unit K: Incorporating Video and Audio.
Neal Stublen Pre-HTML5 Solutions  Audio and video were embedded in pages using plug-ins Apple Quicktime Microsoft Silverlight Adobe.
HTML5 Application Development Fundamentals
Never miss a moment! Photosequence in Windows 8.1 Preview. Building an app using Capture APIs. Camera controls in Windows 8.1 Preview. Adding custom.
Video, audio, embed, iframe, HTML Form
Windows Azure 4/15/2017 Building media streaming apps and sites without plug-ins using MPEG-DASH Daniel Schneider Senior Lead Program Manager, Microsoft.
Private cloudFrameworksClientsPublic cloud Microsoft ® Media Platform Video Editor Content Manager Microsoft ® Media Platform Player Framework Microsoft.
XML To this point, we’ve pretty much ignored or brushed over the use of xml What is xml? – xml is eXtensible Markup Language – it is a metalanguage for.
Bartosz Kowalski Software Developer CERN. Presentation outline -HTML : introduction and history -HTML5 : -History and philosophy -New features -Structure.
Integrating media playback on embedded devices. DTG HTML5 workshop, London, 3 rd July 2015.
M4: Multimedia and Devices
                      Digital Video 1.
Advanced Windows 8 Apps Using JavaScript Jump Start Exam Prep Advanced Windows 8 Apps Using JavaScript Jeremy Foster Microsoft Developer Evangelist.
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Creating Amazing Video Experiences on BlackBerry PlayBook Rajeev Massand |
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
Creating apps that use video and audio
Building video application for windows 8 with Windows Azure Media Services Mingfei Yan Program Manager Microsoft Corporation WCL332.
Video on the Web. The Evolution of web video formats… WebM (Supported by Google) Ogg (Supported by Theora) Mp4 (h264 video encoding) WebM (Supported by.
CHAPTER 18 INTEGRATING AUDIO AND VIDEO. LEARNING OBJECTIVES How the HTML 5 and tag pair can be used to include a video file within a webpage How video.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
Multimedia and Web Technology Prepared by: Asst. Prof. Maryam Eskandari.
What’s new for Windows 8 Devs Part 3 Lewis Benge Devices & Integration Team TBWA\Digital Arts Network DEV216.
Building the User Interface by Using HTML5: Text, Graphics, and Media Lesson 2.
Creating Multimedia Interaction with Windows Media Technologies 7.
Windows Movie Maker Create and Download a Movie. Objectives □ Create a small video □ Download a video from a video camera to a computer.
Supplementary Materials on Web Authoring. Insert Anchors & Add Hyperlinks Insert other multimedia elements: Flash animations Video clips & Audio clips.
Windows 8 Apps Guy Burstein Technical Evangelist, Microsoft
1 Begin the editing process by selecting method of importing video Use the Movie Task Menu to import, edit and save video Follow this menu to complete.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Provides a rich set of media features in easy-to-use APIs Allows you to build cutting-edge apps with advanced media functionality taking full advantage.
HTML5 Audio and Video. Slide 2 History Playing audio and video used to be something of a novelty You would embed a control (with the element) into your.
Storage Device Design Pattern JEFF MEISSNER; KEN HARDY Windows Program Management.
HTML 5. Introduction In modern browsers, adding a video to your page is as easy as adding an image. No longer do you need to deal with special plug-ins.
Ulead Video Studio is an easy to use video editing software that allows even the novice of movie makers to produce a professional project complete with.
Managing the Application Life Cycle
®® Microsoft Windows 7 Windows Tutorial 7 Managing Multimedia Files.
How to Get around on a ipod Table of Contents Which ipod are you ? There are 6 different ipods they have some different features but all do the same.
An Introduction.  Introduction  Logging in from D1  Raison d'être  RSS and Podcasting  DragonDrop is…  What does it do?  Upload  Available Output.
Chapter 8 Adding Multimedia Content to Web Pages HTML5 & CSS 7 th Edition.
CHAPTER 8 Multimedia 1. Using Multimedia ❖ Multimedia: the combination of text, sound, and video to express an idea or convey a message. ❖ Podcasts: a.
What is Windows Movie Maker? Windows Movie Maker is an easy to use video editing software that allows you to make home movies, automated photo albums,
Martin Kruliš by Martin Kruliš (v1.1)1.
CHAPTER 10 AUDIO AND VIDEO. MEDIA PLAYER API HTML5 contains an API (Application Programming Interface) for controlling audio and video players embedded.
Basic Multimedia Equipment
Accessing the device native APIs
Enterprise Town Hall solution
Chap 3. Audio/Video api.
Windows Phone 8.1 New Features
Media fundamentals of a communications app
Inserting Graphics, Media, and Objects
Audio and Video Chapter 10.
Integrating with the Windows Device Experience
Playing Audio (Part 1).
Client-Side Internet and Web Programming
.NET and .NET Core 7. XAML Pan Wuming 2017.
Building a great Metro style device app for your camera
CIS 136 Building Mobile Apps
Platform for Metro style Apps
Presentation transcript:

Your Metro style app, video and audio, Part 1 4/23/2017 3:44 PM PLAT-775T Your Metro style app, video and audio, Part 1 Gabe Frost Senior Program Manager Lead Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo Music & Video apps It’s easy to build tailored playback experiences with rich file metadata.

Agenda Delivering great tailored audio and video experiences Media platform HTML5 Media Elements Programming Model A word on formats Recap You’ll leave with examples of how to Create apps with rich, integrated media experiences Incorporate media into your apps in new ways

Building apps with great audio and video experiences is easy.

Use media to make apps more visually rich and engaging. demo Weather app Use media to make apps more visually rich and engaging.

With media APIs + Media Elements Take advantage of graphics hardware and devices with little domain knowledge Easy to build tailored user experiences with built-in UI and controls Simple to use media from sources other than web servers, like Local or HomeGroup PC libraries and network attached storage Demanding scenarios like streaming, 3D and DRM are simplified because of the powerful and extensible underlying media platform

Windows Metro Style App <audio src=“…”> <video src=“…”> Media platform Windows Metro Style App <audio src=“…”> <video src=“…”> WinRT (Windows.Media) Playback/Preview Capture Transcode Streaming Media Foundation Audio/Video Source Video Decoder Video Effect 1 Video Effect N Video Encoder Audio/Video Sink Audio Decoder Audio Effect 1 Audio Effect N Audio Encoder

HTML5 Media Elements

Standard HTML5 <audio> and <video> W3C HTML5 Spec You can create rich media experiences by combining with CSS and JavaScript and DOM events Fully hardware accelerated Performance, battery life and reliability Select methods and attributes play() pause() load() audioTracks readyState controls currentTime duration error src playbackRate preload volume …

Standard HTML5 <audio> and <video> HTML Video Tag Events abort canplay canplaythrough durationchange emptied ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeking seeked suspend stalled timeupdate volumechange waiting

Example: HTML5 Audio and Video Elements <!-- Attributes allowed on both tags: src, preload, autoplay, loop, controls. Video tags also support poster, width, height, muted. Both support many events (e.g. volumechanged) --> <audio id="myAudioTag" src="mySong.wma" preload="none" /> <audio src="mySong.m4a" autoplay loop controls /> <video id="myVideoTag" src="myVideo.mp4" preload="none" /> <video src="myVideo.wmv" autoplay loop controls /> <video src="myVideo.mp4" autoplay muted /> <video src="myAudio.mp3" poster="myImage.jpg" controls />

Example: HTML5 Audio and Video Elements <audio id="myAudio" src="http://www.contoso.com/track1.mp3" autoplay /> <script type="text/javascript"> var audio = document.getElementById("myAudio"); // Handle when the audio track has reached the end audio.addEventListener("ended", function() { // Switch the audio src to a new track audio.src = "http://www.contoso.com/track2.m4a"; }); </script>

Example: Local files with Media Elements <video id="player" controls autoplay /> <script type="text/javascript"> // Invoke a file picker for the user to select media from the file system var picker = new Windows.Storage.FileOpenPicker(); picker.pickSingleFileAsync(). then(function(file) { // Create a URL to represent the local file var url = URL.createObjectURL(file); document.getElementById("player").src = url; }); <script>

Example: Accessing file metadata // Programmatically select the file (could also be from home network storage) var file = new Windows.Storage.KnownFolders.musicLibrary.getFileAsync("track.mp3"). // From the file, extract media-specific properties then(function(myFile) { myFile.properties.getMusicPropertiesAsync(). then(function(musicProps) { var album = musicProps.album; var artist = musicProps.artist; var title = musicProps.title; // etc. });

Windows 8 enhancements 3D video Audio and video effects and extensibility Audio output selection such as Bluetooth Background audio DRM such as PlayReady Low-latency support for communications & games Play To for streaming to TVs & audio systems Zoom and mirror mode for video

Programming Model

Windows.Media APIs Much more than playing video and audio Snap a picture, record video and audio Capture Devices Input and output audio devices such as Bluetooth Playlists Work with audio playlists Windows.Media. Stream media to a television or audio system PlayTo Protection Use PlayReady or other content protection systems Convert music or video to other formats or resolutions, trim, or make effects permanent Transcoding VideoEffects Insert or remove well-known video effects such as Stabilization

Streaming to devices with Play To demo Streaming to devices with Play To HTML5 websites using IE10, Music, Video and Photo apps work today. Simple to support in your Metro style apps

Example: Stream media with Play To (JS) <video id="videoplayer" src="http://www.contoso.com/clip.mp4" controls autoplay /> <script type="text/javascript"> // Step 1: Obtain PlayToManager object for app’s current view. var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView(); // Step 2: Register for the sourcerequested event (user selects Devices button). ptm.addEventListener("sourcerequested", function(e) { var request = e.sourceRequest; // Step 3: Specify the media to be streamed (to filter devices) var deferral = request.getDeferral(); request.setSource(document.getElementById("videoplayer").msPlayToSource); deferral.complete(); // The media will then be streamed to the device chosen by the user in the UI. }); </script>

Example: Stream media with Play To (C#) <MediaElement x:Name="videoplayer" Source="http://www.contoso.com/clip.mp4" AutoPlay="true" /> // Step 1: Obtain PlayToManager object for app’s current view. PlayToManager ptm = Windows.Media.PlayTo.PlayToManager.GetForCurrentView(); // Step 2: Register for the SourceRequested event (user selects Devices button). ptm.SourceRequested += (PlayToManager sender, PlayToSourceRequestedEventArgs e) => { request = e.SourceRequest; // Step 3: Specify the media to be streamed. PlayToSourceDeferral deferral = request.GetDeferral(); request.SetSource(videoplayer.PlayToSource); deferral.Complete(); } // The media will then be streamed to the device chosen by the user in the UI.

demo Camera Capture UI It’s easy to snap a photo or record video by invoking the built-in capture UI.

Use the camera to snap a photo // Application manifest capabilities required to access camera and microphone <Capabilities>     <DeviceCapability Name="webcam" /> <DeviceCapability Name="microphone" /> </Capabilities>

Use the camera to snap a photo <img id="preview" /> <script type="text/javascript">   // Invoke the camera capture UI for taking a photo var captureUI = new Windows.Media.Capture.CameraCaptureUI(); captureUI.captureFileAsync(Windows.Media.CameraCaptureUI.Mode.photo). then(function(capturedItem) { if (capturedItem) { // Display the photo document.getElementById("preview").src = URL.createObjectURL(capturedItem); } }); </script>

demo Simple Encode app Convert media files into different formats, resolutions or trim to a specific timeframe.

Transcode to a different format var outputFile; var vidLib = Windows.Storage.KnownFolders.videosLibrary; var transcoder = new Windows.Media.Transcoding.MediaTranscoder(); // Choose a popular output format and quality var profile = Windows.Media.Capture.MediaEncodingProfile. createMp4(Windows.Media.Capture.VideoEncodingQuality.vga); // Create the file to transcode into, and select the input file to read from vidLib.createFileAsync("output.mp4"). then(function(result) { outputFile = result; return vidLib.getFileAsync("test.wmv"); // Transcode the file }).then(function(inputFile) { return transcoder.transcodeFileAsync(inputFile, outputFile, profile); }).then(function() { // log "done" });

Simple trim var outputFile; var vidLib = Windows.Storage.KnownFolders.videosLibrary; var transcoder = new Windows.Media.Transcoding.MediaTranscoder(); // Specify the start and stop time defining the portion to keep // Create the file to transcode into, and select the input file to read from vidLib.createFileAsync("EditedVacation.mp4"). then(function(result) { outputFile = result; return vidLib.getFileAsync("vacation.mp4"); // Trim the file: profile isn’t changing so profile argument isn’t needed }).then(function(inputFile) { return transcoder.transcodeFileAsync(inputFile, outputFile); }).then(function() { // log "done" }); transcoder.trimStartTime = 900; transcoder.trimStopTime = 6000;

A word on formats

Media Formats and Codecs System-wide File format: MP4 (preferred) or ASF Video: H.264 or VC-1 Audio: AAC, MP3 or WMA Broad support across consumer hardware: great performance and battery life Per-app Your Metro style app can package private plug-ins for its own use (e.g. adaptive streaming)

Recap

With media APIs + Media Elements Take advantage of graphics hardware and devices with little domain knowledge Easy to build tailored user experiences with built-in UI and controls Simple to use media from sources other than web servers, like Local or HomeGroup PC libraries and network attached storage Demanding scenarios like streaming, 3D and DRM are simplified because of the powerful and extensible underlying media platform

Related sessions [PLAT-776T] Your Metro style app, video and audio, Part 2 [APP-788T] Integrating stunning media experiences in XAML [PLAT-777T] Capturing personal photos, video, and audio in Metro style apps [HW-715T] Building a great Metro style device app for your camera [PLAT-778T] Media fundamentals of a communications app [PLAT-783T] Extending the media platform using input, output and processing plug-ins [HW-177T] Building great networked media devices for Play To apps [APP-408T] Integrating with the Windows device experience [HW-329T] Understanding Wi-Fi Direct in Windows 8

Further reading and documentation Design guidelines for Play To receivers Streaming media to devices using Play To Play To & media streaming for Metro style apps Using audio hardware acceleration for ultra-low-power consumption.

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

4/23/2017 3:44 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

BACKUP

Use the camera to snap a photo (C#) // Define capture element in XAML <captureElement x:Name="preview" Width="320" Height="240" Margin="10,5,10,5" /> // Initialize mc = new MediaCapture(); Windows.Media.Capture.InitializeOperation opInitialize = await mc.initializeAsync(); // Assign the source preview.Source = mc; // Start the preview Windows.Media.Capture.StartPreviewOperation opStartpreview = await mc.StartPreviewAsync();

Transcode to a different format (C#) // Select the input file to read from StorageFile input = await KnownFolders.VideosLibrary.GetFileAsync("input.wmv"); // Create the file to transcode into StorageFile output = await KnownFolders.VideosLibrary.CreateFileAsync("output.mp4");   // Choose a popular output format and quality MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga); // Transcode the file MediaTranscoder transcoder = new MediaTranscoder(); await transcoder.TranscodeFileAsync(input, output, profile);

Simple trim (C#) // Select the input file to read from StorageFile input = await KnownFolders.VideosLibrary.GetFileAsync("input.mp4"); // Create the file to transcode into StorageFile output = await KnownFolders.VideosLibrary.CreateFileAsync("output.mp4");   MediaTranscoder transcoder = new MediaTranscoder(); // Specify the start and stop time defining the portion to keep // Trim the file: profile isn’t changing so profile argument isn’t needed await transcoder.TranscodeFileAsync(input, output); transcoder.TrimStartTime = 900; transcoder.TrimStopTime = 6000;