android Media Router
来源:互联网 发布:amarra hifi mac 编辑:程序博客网 时间:2024/05/13 06:55
>As users connect their televisions, home theater systems and music players with wireless technologies, they want to be able to play content from Android apps on these larger, louder devices. Enabling this kind of playback can turn your one-device, one-user app into a shared experience that delights and inspires multiple users.
>The Android media router APIs are designed to enable media display and playback on these secondary devices:Remote Playback;Secondary Output
>the media router framework
>The media router APIs are provided as part of the Android Support Library version 18 and higher, in the v7-mediarouter support library. Specifically, you should use the classes in the android.support.v7.media
package for media router functions. These APIs are compatible with devices running Android 2.1 (API level 7) and higher.
When creating a MediaRouteSelector
object, use the MediaRouteSelector.Builder
class to create the object and set the media playback categories (control categories), as shown in the following code sample:
public class MediaRouterPlaybackActivity extends ActionBarActivity { private MediaRouteSelector mSelector; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Create a route selector for the type of routes your app supports. mSelector = new MediaRouteSelector.Builder() // These are the framework-supported intents .addControlCategory(MediaControlIntent.CATEGORY_LIVE_AUDIO) .addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO) .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK) .build(); }}An app that uses the media router framework must extend the
MediaRouter.Callback
object in order to receive messages when a media route is connected.>Secondary devices can include televisions or wireless sound systems and can be attached through wireless protocols or wires, such as an HDMI cable.
>
The following code sample shows a minimal implementation of a Presentation
object, including aGLSurfaceView
object.
public class SamplePresentation extends Presentation { public SamplePresentation(Context outerContext, Display display) { super(outerContext, display); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Notice that we get resources from the context of the Presentation Resources resources = getContext().getResources(); // Inflate a layout. setContentView(R.layout.presentation_with_media_router_content); // Add presentation content here: // Set up a surface view for visual interest mSurfaceView = (GLSurfaceView)findViewById(R.id.surface_view); mSurfaceView.setRenderer(new CubeRenderer(false)); }}
- android Media Router
- Android API Guides---Media Router
- Android Api Demos登顶之路(十三)Presentation With Media Router
- android router
- android router
- android media
- Android构建Router框架
- Android Router路由框架
- Android Media Scanner Process
- Android多媒体(Media)入门
- Android多媒体(Media)入门
- class android.media.MediaPlayer
- Android[Media][1] Camera
- android media 播放器
- android media 播放器
- android media service
- Android Supported Media Formats
- android.media.AsyncPlayer
- javac 和java 使用的 -classpath 参数
- BT
- 讲义4:数据的插入和修改
- Acm - 百钱买百鸡问题
- 野人学Android第二弹——照片的拍摄与存储(二)
- android Media Router
- python实现密度聚类
- 《TCP/IP详解 卷1:协议》 读书笔记 第六章 ICMP:Internet控制报文协议
- 安装Atom及运行插件activate-power-mode的过程
- java并发基础--线程
- java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFactory class
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
- 深入剖析指针传参——入门篇
- 利用css3实现不规则图像