字幕组成品列表(Beta)
  • 写在前面
  • Android 平台
    • Game On! 游戏开发系列 - 031
      • Pie Noon - 1503060393
      • The Death of Base Game Activity - 1504030543
      • Surviving OpenGL Context Loss - 1504030546
      • WebP for Game Devs - 1504030547
      • Saved Games In-Depth (Part 1) - 1504070556
      • Saved Games In-Depth (Part 2) - 1504030548
      • Smaller Flipbook Textures with CRABBY - 1504030544
      • Google Tag Manager - 1504030545
      • Flatbuffers - 1505050794
      • Achievement Point Pointers - 1505050796
      • Frequency Scaling - 1505050797
      • Meet the Management APIs - 1501140367
      • Y U Ship Broken Games - 1505050795
    • Android 性能优化 - 088
      • Garbage Collection in Android - 1503170425
      • Performance Cost of Memory Leaks - 1503170424
      • Rendering Performance 101 - 1501130351
      • Understanding Overdraw - 1501130352
      • Understanding VSYNC - 1501130353
      • Tool - Profile GPU Rendering - 1501130354
      • Why 60fps? - 1501130355
      • Android UI and the GPU - 1501130356
      • Invalidations, Layouts, and Performance - 1501130357
      • Overdraw, Cliprect, QuickReject - 1501130358
      • Tool - Memory Monitor - 1501130363
      • Battery Performance 101 - 1501130364
      • Understanding Battery Drain on Android - 1501130365
      • Battery Drain and WakeLocks - 1501130366
      • Memory Performance 101 - 1504170661
    • I/O 2014 Android 开发专题 - 089
      • Activity Transitions - 1504020505
      • Building Apps For Android TV - 1504020520
      • Building great Android media experiences - 1504020510
      • Building a quality app from start to finish - 1504020515
      • App Indexing API - 1504020507
      • What's new in WebView - 1504010484
      • Bluetooth Low Energy - 1504010486
      • Building impressive Android media experiences - 1504010493
      • The next Generation of Authentication - 1504020497
      • Don't Alpha That Pixel! - 1504020523
      • NFC + HCE Your phone in an interactive world - 1504020509
      • Demystifying encodes and decodes of WebM - 1504020521
      • Google Cloud Messaging - 1504020524
      • Getting your Game on the Big Screen - 1504020518
      • I hear you like realtime memes - 1504020511
      • Offerize your App - 1504020506
      • Using the Android Job Scheduler - 1504020504
      • From Holo to Material - 1504020526
      • Under the Hood of Android Auto - 1504020501
      • Isolation for Android App Developers - 1504020498
      • Android Work - 1504010496
      • ExoPlayer: Adaptive video streaming on Android - 1504010489
      • Sample rates and resampling: Why can't we all just agree? - 1504010488
      • Drive Android API - 1504010485
    • Android Studio - 004
      • Layout Editor (Ep 3, Android Studio) - 1503290479
      • Introducing Gradle (Ep 2, Android Studio) - 1503170426
    • I/O 2014 Android 分发主题 - 091
      • Introduction to Google Play - 1504030534
      • Google Play: building your user community - 1504030535
      • Optimizing Apps for Education - 1504030536
      • Succeeding in Education Technology - 1504030530
      • Subscriptions Made Easy with Google Play - 1504030531
      • The world is your playground - go global with Google - 1504030533
      • Maximizing discoverability on Google Play - 1504030538
    • Android Auto - 003
      • Introduction to Android Auto - 1504130615
      • Android Auto Messaging - 1504130617
      • Android Auto Audio - 1504130616
    • Android Wear - 006
      • Designing for Android Wear - 1503210448
      • How We Customized Google Apps for Android Wear - 1503210450
      • Fullscreen apps for Android Wear - 1503210445
      • New Notification Features for Android Wear - 1503210446
      • Building Cloud-powered wearable Apps - 1503210449
      • An Introduction to Android Wear - 1503190435
      • Google I/O 2014 - Android Wear: The developer's perspective - 1503210442
      • Devoxx 2014 Interviews: Android Wear - 1503210440
      • DevBytes: Watch Faces for Android Wear - 1503210439
    • Android TV - 005
      • Using the Leanback library - 1504080588
      • Beach Buggy Racing Multiplayer with Nearby Connections (Play Services) - 1503060387
    • Android for Work - 106
      • Android for Work for Developers - 1503060390
      • App Configurations, Testing and Launchers - 1504110590
    • IO Bytes 2014 - Android - 066
      • Chrome Apps on Android and iOS - 1501080014
      • Perf Primer CPU, GPU and your Android game - 1501080017
  • Chrome 平台
    • IO Bytes 2014 - Chrome and Web - 067
      • Using the PageSpeed API - 1505070815
      • Fabulous Forms for the multi-device web - 1505070816
      • Testing multi-screen web pages - 1505070817
      • Responsive images today - 1505070819
      • Web Performance Testing at YouTube - 1505070828
      • Building sites for the multi-device web - 1505070820
      • Deep dive: Google Cloud Messaging for Chrome - 1505070827
  • Google 创业者资源
    • Coffee with a Googler - 012
      • Chat with Allen Huang of AndroidTV - 1503040384
      • Chat with Fred Chung about developer advocacy - 1503070395
      • Google Fit platform with Michelle Haq - 1503210443
      • Android Auto Product Manager Andrew Brenner - 1501120027
      • Chat with Francis Ma about Google Play services - 1501120028
    • Root Access For Startups - 077
      • What we learned building plug-ins for Android, with startup Magnet - 1503230453
      • How to use crowdfunding to your advantage, with startup Hale Devices - 1503280462
      • How to overcome customer objections when selling tech, with startup Guesswork - 1503280458
    • First Things First - 029
      • Getting started with Android: A crash-course in developing for Android - 1504120601
      • How to ask a question: conducting research for your startup - 1504120603
      • MVP Design Hacks: transform your hot idea into a validated prototype - 1504120602
      • Build something people want: Solving real problems - 1504120605
    • How I - 061
      • Use BigQuery to find my most valuable customers - 1504070573
      • Manage beta testing communities using Google Play - 1504070572
      • Use paper wireframing to build native prototypes - 1504070570
      • Used social media and $0 marketing to get 68 million users - 1504070568
      • Prep to fundraise with four questions - 1504070564
      • Validated my idea in 2 days (with no code) - 1504070562
      • Build open platforms on Android - 1504120596
      • Get cheap, automatic analytics for my business using BigQuery - 1504070571
      • Write press releases to get international media coverage - 1504070569
      • Test beta-product features using Google Apps - 1504070563
      • Use URL builder to measure ROI on social media - 1504070561
      • Use events to build DeadSocial's brand - 1504070557
      • Use BigQuery to visualize streaming data - 1503220452
      • Find, screen, and hire developers - 1503120406
      • Drive engagement with social challenges - 1504070558
  • 设计
    • DesignBytes - 017
      • Paper and Ink: The Materials that Matter - 1505050793
  • 云计算
    • DevBytes: Google Cloud Platform - 021
      • Powering the next killer app with the Google Cloud Platform - 1504210672
      • Introduction to Google Cloud Endpoints - 1504210675
      • The Beauty of Scale with Google Cloud Platform - 1504210678
    • Google Cloud Platform - Big Data - 105
      • GDELT & BigQuery: Understand the world - 1502200379
    • Uncategorized - 999
      • Introducing Google Cloud Platform Resources - 1501190370
  • Google 应用开发
    • Launchpad Online - 072
      • The Setup: Creating new apps using Google APIs - 1503190428
      • Listing your files in Google Drive - 1503190429
      • Customizing Google Analytics for your startup - 1503290473
      • The Launchpad Online series - 1503190427
      • Getting started with Google Analytics - 1503290472
      • Accessing Google Maps from a spreadsheet?!? - 1502220381
      • Change the world in 10 lines of code - 1503080398
    • Google Play Services - 054
      • Google Play services 6.1 - 1503290481
      • Google Play Services 7.0 - 1503200437
      • Google Play Services 6.5 - 1501080015
    • 谷歌地图 iOS SDK - 053
      • Maps Live: New Features in the Google Maps Mobile APIs for Android and iOS - 1504300777
    • Google 移动搜索开发 - 055
      • Is your app in the Google index? - 1504120598
      • Get more engaged users with Google Search for Developers - 1503070397
    • DevBytes: Google Cast - 020
      • Google Cast SDK for Android - 1504180666
      • Media Router Framework - Part 1 - Media Router API - 1504180667
      • Overview for Google Cast Receivers - 1504180664
      • Google Cast SDK for iOS - 1504180663
    • Getting Started with the Google Maps SDK for iOS - 035
      • Getting started with the Google Maps SDK for iOS, Part 1 - 1504270757
    • IO Bytes 2014 - Wearables - 070
      • Voice Driven GDK Glassware - 1505280836
    • Route 85 - 078
      • Introducing Route 85 - 1501120022
      • Quick Tip: Don't Default that Switch! - 1501190371
      • OpenInChrome on iOS, Part 1 - 1501120023
      • OpenInChrome on iOS, Part 2 - 1501120024
      • OpenInChrome on iOS, Part 3 - 1501120025
      • OpenInChrome on iOS, Part 4 - 1501120026
    • DevBytes 2014 - 019
      • Web Components - Template - 1505040789
      • Wearable DataLayer API - 1505050792
      • Using srcset for responsive images - 1505050790
      • The picture element for art direction - 1505050791
    • Uncategorized - 999
      • Sun Surveyor brings augmented reality to photographers using Google Maps APIs - 1504200668
      • Snappy travels with the Roads API - 1503060392
      • Easy Maps Apps in Java and Python - 1501140030
  • Google 广告平台
  • Polymer
    • Polycasts - 076
      • The Awesome Power of Auto-Binding Templates -- Polycasts #08 - 1502220382
      • Content Switcheroo with Core-Pages -- Polycasts #09 - 1502200380
      • Core Iconset -- Polycasts #02 - 1505040788
  • Web 平台
    • HTTP 203 - 062
      • Gotchas - 1501140368
      • Font Rendering - 1501080016
    • Web Components - 081
      • DevBytes: Web Components - Overview - 1504250709
  • 宣传视频
    • Uncategorized - 999
      • Google Developers - 1501150369
      • I/O Extended 2014 - Join me - 1502220383
  • Google 各类开发者会议
    • 2014 Chrome 开发者高峰会议 - 009
      • Keynote - Chrome Dev Summit 2014 (Darin Fisher) - 1503120407
      • TLS All the Things! - Security with Performance(Chris Palmer) - 1503140412
      • Let’s build some apps with Polymer!(Rob Dodson) - 1503150415
      • Day One Closing Remarks(Sundar Pichai) - 1503150417
      • Chrome Leadership panel - 1503160422
      • Fundamentals of Mobile Web Development(Matt Gaunt) - 1503150416
    • 2015 游戏开发者大会中 - 039
      • FlatBuffers - 1504150640
      • Games for Google Cast - 1504150637
      • Top 10 Things Android Game Developers Should Know v 3.0 - 1504150643
      • Automate Publishing for Google Play APIs - 1504150639
      • 3 Game Design Mistakes You're Making - 1504150636
      • Android TV - 1504150638
      • How to Go Viral Without Really Trying - 1504150641
    • Devoxx 2014 Interviews - 024
      • What's new in Android 5.0 Lollipop - 1504260740
      • Android Tools - 1504260743
      • BigQuery and user-defined functions - 1504260744
    • IO Bytes 2014 - 065
      • Dart in Google Cloud - 1505070810
      • Big genomic data on Google Cloud Platform - 1505070811
      • Easy International Checkout with Chrome - 1505070802
      • Google developer tools and APIs for iOS - 1503190436
      • Whet your appetite with IO Bytes - 1501080021
    • PlayTime@Shanghai - 095
      • 主题演讲 Chris Yerga - 1504060549
      • 如何成功地开发你的应用 Ellie Powers - 1504060550
      • 在Google上营利 Brahim Elbouchikhi - 1504060551
      • Playtime Shanghai event sizzle reel - 1504070552
    • Project Google I/O 2015 - 098
      • Project Tango Mobile 3D tracking and perception - 1506120857
      • Democratizing Education - 1506120868
      • Improve your Android app’s accessibility - 1506120864
      • Google Cloud Messaging 3.0 - 1506120844
      • Developers connecting the world through Google Play - 1506120862
  • 开源开放技术
    • Compressor Head - 013
      • The Trailer, Season 2 - 1503060385
      • Behind the Scenes - 1503210441
      • Arithmetic Compression (Ep 5, Compressor Head) Google - 1503070394
      • Introducing Compressor Head - 1502120372
      • Episode 1 (Variable Length Codes) - 1502120373
      • Episode 2 (The LZ77 Compression Family) - 1502120374
      • Episode 3 (Markov Chain Compression) - 1502120375
Powered by GitBook
On this page
  • 译者信息
  • 解说词中文版:

Was this helpful?

  1. Android 平台
  2. I/O 2014 Android 开发专题 - 089

Building great Android media experiences - 1504020510

PreviousBuilding Apps For Android TV - 1504020520NextBuilding a quality app from start to finish - 1504020515

Last updated 5 years ago

Was this helpful?

视频发布时间

2014年6月25日

视频介绍

Learn how to use the high-level Android multimedia APIs to quickly add media to your application, and create a great multimedia experience. This session will cover video playback and recording, controlling subtitles, and taking advantage of external displays.

视频推介语

暂无,待补充。

译者信息

翻译

润稿

终审

原始链接

中文字幕

翻译流水号

加入字幕组

TWL007

贺颂

暂无

1504020510

解说词中文版:

画面 声音和音乐是我们每日生活中

重要的组成部分

对Android的生态环境以及应用方面来说更是如此

我是来自Android视频框架团队的Lajos

我将要讲述的是如何利用

我们一些专注视频的新API来

在Android上创造卓越的多媒体体验

好消息是你没必要作为一个访客

来将令人印象深刻的多媒体元素加入到你的程序中

因为Android已经为你做了很繁重的工作了

Android 拥有易用的高级API

可以让你用最小的工作量去

完成一些很常见的媒体任务

也就是说 可以去轻松的播放和录制视频

也可以轻松的去利用外部显示器

让我们讨论一下视频播放

准备好听一些好消息了么

这是最新加入的

在Android L的开发者预览中

当你使用高级API的时候

我们已经极大的改善了大多数视频播放时候的帧数表现

好了 我们继续

在Android中 最简单的回放视频方式是使用intents

这样做的好处是用户可以使用他们喜好的播放器

但换句话说

这意味着你无法控制回放体验

因此 当回放体验不是你的程序的主体时

你可以使用这种方式

当使用intents来播放媒体文件的时候

总是要设置文件类型 就像在本节的代码示例中描述的那样

这样系统可以为你的文件选择

最适合的媒体播放器

另一个最简单的播放视频的方法是使用系统播放器

MediaPlayer在最早期的Android中就已经存在了

它是把你的视频加入应用中最简单的方式

它包含一些播放控制

比如暂停 快进 以及选择输出在哪个surface

MediaPlayer的文档覆盖面很广

查看API参考 并不要错过API指南

中对一些常见任务以及问题的建议

MediaPlayer可以用来播放本地文件

以及来自网络的流媒体

支持的文件包含3GP MP4 和通过RTSP或者HTTP流

传输的WebM文件

MediaPlayer也可以播放一些使用

HLS HTTP实时流的自适应视频

请点击屏幕上的链接

获取更多支持的数据源和媒体文件格式的信息

现在让我们更深入的探讨如何 或更适当的

选择视频播放的位置

MediaPlayer可以在一个既可以是SurfaceView

也可以是一个GL texture的surface来显示视频

在Ice Cream Sandwich中也加入了对TextureView的支持

建议一句

Surfaces也许会被动态的改变或删除

所以建议将它作为Surface Holder Listener来实现

这就是你如何在SurfaceView上播放你的视频

使用SurfaceView的主要优势是

这是唯一一种可以让你播放受保护内容的方式

然而 因为它是一个window 并不是技术上所说的view

它不能像其他的view一样使用动画效果

下面 是一个更高级地使用TextureView的例子

在API Level 14中所介绍过的TextureView

除了使用GL textures 其他方面看起来像一个SurfaceView

并且他是一个真正的view

正因为如此 它可以被应用动画效果

你也可以在一个GL composition中使

用一个带有texture输出的媒体播放器

并且显示在一个GLSurfaceView或TextureView中

这就是你如何配置你的MediaPlayer来使用Surface Texture

最新添加到MediaPlayer中的

一个特性是支持显示字幕

在Android KitKat中就已经被介绍过了

你需要使用VideoView来实现这个

VideoView基本上就是一个带有专用MediaPlayer对象

加上显示字幕能力的SurfaceView

Android KitKat加入了对WebVTT格式字幕的支持

然而 一些WebVTT的特性现在并不被支持

使用MediaPlayer getTrackInfo来获取支持的字幕轨

如果播放一个HTTP实时流媒体

WebVTT字幕轨内部会自动包含一个媒体轨列表

你也可以使用VideoView的Add Subtitle Source方法来加入字幕轨

就像这里描绘的一样的

你可以使用MediaPlayer's OnInfoListener来

监视成功添加的字幕轨

如果一个字幕轨被成功添加

一个新轨就会被创建

onInfo会被带着metadata update来调用

换句话说 如果一个错误发生

onInfo会带着不支持的字幕或者

字幕时间超时的信息被调用

你不能以程序的方式来开启或关闭字幕

这个只能通过你使用这个高亮的intent来

弹出的System Preferences来设置

在一个VideoView上同一时间

只能最多选择一个字幕轨

默认的情况下 会选择最符合

System Preferences的第一个轨

如果没有轨符合要求 就会是个空轨

如果设置改变 默认轨选择也会

再自动执行一遍

每个字幕拥有四个

对应轨选择的属性

前三个 强制 默认 以及自动选择是是否选项

这些经常被普遍的用于字幕

最后一个 可以说是最不重要的属性

是字幕的语言

默认轨选择十分复杂

每个轨会被使用好几个元素来衡量

如果字幕开启 第一个以及大多数情况下

我们首选项是选择没有被标记强制的轨

之后 我们首选选择被标记为默认的轨

只有当你的字幕语言设置到

默认的时候这个标准才会生效

第三 我们首选使用那些标记为自动选择的轨 那些我们估计没问题的

除非另有标记

最后 我们选择符合设置的字幕语言的轨

轨必须至少拥有一个设置标记

或者明确的符合默认设置的字幕语言来参与评级

如果字幕关闭 只有强制轨会被考虑

但是其他的优先参考标志依旧会保留

应用也可以使用MediaPlayer的选择轨 取消轨功能

来以程序的方式设置字幕轨

当这些完成的时候 不管怎么样 在System Preferences中的设置

不会再影响选择的字幕轨

直到VideoView被重置

现在你自己可以设置所有东西了

但是还没完事

你可以也应该注册CaptioningChangeListener回调

就像这里描述的 这样当字幕开启或者关闭

或者本地设置改变的时候

你就可以收到通知了

其他两个回调 字体以及样式改变

字幕渲染已经为你处理这些东西了

现在让我们说一下录制视频

最简单的录制视频的方法 跟你所猜的一样

就是使用intents 这样可以使用用户希望使用的摄像头

来记录视频到一个文件中

只有一种非常受限的方式

来支持设置录像参数

因此 录制视频的质量会极其

依赖于用户的设备

以及所使用的录像程序

因此 如果良好的视频录制质量不是你任务必需的一部分

我们会推介这种方式

你可以在这个链接中找到更多的

关于如何使用intents来录制视频的细节

抓取或录制视频到一个本地文件的

首选容易方式是使用系统MediaRecorder

MediaRecorder伴随着Android的整个历史历程

它允许你对视频进行一些层级上的控制

比如视频的分辨率以及格式

我并不打算对其讨论太多

因为那里已经有一个很不错的

来教你使用MediaRecorder录制视频的开发者指南

去观看那个视频

并使用MediaRecorder

就剩下一件事情了

在Android L开发者预览中 加入了

从Surface中记录视频的支持

只是

我还没能拨云见日

谈论白热化的事物

看起来每个人都在兴奋的谈论第二块屏幕体验

Android已经帮你涵盖了这个功能

你可以使用Google Cast SDK来传输内容到一个广播接收设备上

比如Chromecast

Android 2.3及以后的设备都支持Cast sender API

从KitKat MR1起

你就可以传输屏幕镜像到Google Cast接收器上

使用presentation class来完成这个目标

演讲是一种特殊的会话

其目的是在第二块显示器上展示特定的内容

对于MediaRouter以及resentation classes

那有很出色的API指南以及参考资料

当然在Android SDK里也有两个奇妙的

使用了显示器管理或MediaRouter来

发现额外屏幕的示例程序

一定要去看一下哦

同时SDK还总结了这一集关于在Android上构建出色

多媒体体验的内容

现在去体验一下这些高级媒体API

更多的信息 如往常一样 访问Android开发者网站来获取

参考 指南 以及示例程序

感谢观看

Youtube
Youtube
加入 GDG 字幕组
video_screenshot