• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MediaPlayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.connectsdk.service.capability.MediaPlayer的典型用法代码示例。如果您正苦于以下问题:Java MediaPlayer类的具体用法?Java MediaPlayer怎么用?Java MediaPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MediaPlayer类属于com.connectsdk.service.capability包,在下文中一共展示了MediaPlayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPriorityLevel

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(VolumeControl.class)) {
        return getVolumeControlCapabilityLevel();
    }
    else if (clazz.equals(WebAppLauncher.class)) {
        return getWebAppLauncherCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:17,代码来源:CastService.java


示例2: displayMedia

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private void displayMedia(JSONObject params, final MediaPlayer.LaunchListener listener) {
    String uri = "ssap://media.viewer/open";

    ResponseListener<Object> responseListener = new ResponseListener<Object>() {
        @Override
        public void onSuccess(Object response) {
            JSONObject obj = (JSONObject) response;

            LaunchSession launchSession = LaunchSession.launchSessionForAppId(obj.optString("id"));
            launchSession.setService(WebOSTVService.this);
            launchSession.setSessionId(obj.optString("sessionId"));
            launchSession.setSessionType(LaunchSessionType.Media);

            Util.postSuccess(listener, new MediaLaunchObject(launchSession, WebOSTVService.this));
        }

        @Override
        public void onError(ServiceCommandError error) {
            Util.postError(listener, error);
        }
    };

    ServiceCommand<ResponseListener<Object>> request = new ServiceCommand<ResponseListener<Object>>(this, uri, params, true, responseListener);
    request.send();
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:26,代码来源:WebOSTVService.java


示例3: playMedia

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, MediaPlayer.LaunchListener listener) {
    String mediaUrl = null;
    String mimeType = null;
    String title = null;
    String desc = null;
    String iconSrc = null;

    if (mediaInfo != null) {
        mediaUrl = mediaInfo.getUrl();
        mimeType = mediaInfo.getMimeType();
        title = mediaInfo.getTitle();
        desc = mediaInfo.getDescription();

        if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
            ImageInfo imageInfo = mediaInfo.getImages().get(0);
            iconSrc = imageInfo.getUrl();
        }
    }

    playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:23,代码来源:WebOSTVService.java


示例4: displayImage

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public void displayImage(MediaInfo mediaInfo,
        MediaPlayer.LaunchListener listener) {
    String mediaUrl = null;
    String mimeType = null;
    String title = null;
    String desc = null;
    String iconSrc = null;

    if (mediaInfo != null) {
        mediaUrl = mediaInfo.getUrl();
        mimeType = mediaInfo.getMimeType();
        title = mediaInfo.getTitle();
        desc = mediaInfo.getDescription();

        if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
            ImageInfo imageInfo = mediaInfo.getImages().get(0);
            iconSrc = imageInfo.getUrl();
        }
    }

    displayImage(mediaUrl, mimeType, title, desc, iconSrc, listener);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:24,代码来源:RokuService.java


示例5: playMedia

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop,
        MediaPlayer.LaunchListener listener) {
    String mediaUrl = null;
    String mimeType = null;
    String title = null;
    String desc = null;
    String iconSrc = null;

    if (mediaInfo != null) {
        mediaUrl = mediaInfo.getUrl();
        mimeType = mediaInfo.getMimeType();
        title = mediaInfo.getTitle();
        desc = mediaInfo.getDescription();

        if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
            ImageInfo imageInfo = mediaInfo.getImages().get(0);
            iconSrc = imageInfo.getUrl();
        }
    }

    playMedia(mediaUrl, mimeType, title, desc, iconSrc, shouldLoop, listener);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:24,代码来源:RokuService.java


示例6: testPlayMediaWithSubtitles

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Test
public void testPlayMediaWithSubtitles() throws JSONException {
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);
    final boolean shouldLoop = true;
    final SubtitleInfo subtitleInfo = new SubtitleInfo.Builder("subtitleurl")
            .setLabel("label")
            .setLanguage("en")
            .setMimeType("subtitletype")
            .build();
    final MediaInfo mediaInfo = new MediaInfo.Builder("url", "type")
            .setIcon("icon")
            .setTitle("title")
            .setDescription("description")
            .setSubtitleInfo(subtitleInfo)
            .build();

    session.playMedia(mediaInfo, shouldLoop, listener);

    verifyPlayMedia(shouldLoop, subtitleInfo, mediaInfo);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:21,代码来源:WebOSWebAppSessionTest.java


示例7: testPlayMediaDeprecatedWithAllParametersOnTheLatestWebOS

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Test
public void testPlayMediaDeprecatedWithAllParametersOnTheLatestWebOS() {
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);
    WebOSWebAppSession webAppSession = Mockito.mock(WebOSWebAppSession.class);
    service.mWebAppSessions.put("MediaPlayer", webAppSession);

    MediaInfo mediaInfo = new MediaInfo.Builder("url", "mimetype")
            .setTitle("title")
            .setDescription("description")
            .setIcon("icon")
            .build();
    boolean shouldLoop = true;
    service.playMedia(mediaInfo.getUrl(), mediaInfo.getMimeType(), mediaInfo.getTitle(),
            mediaInfo.getDescription(), mediaInfo.getImages().get(0).getUrl(), shouldLoop,
            listener);

    verifyPlayMediaOnTheLatestWebOS(mediaInfo, shouldLoop, listener, webAppSession);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:19,代码来源:WebOSTVServiceTest.java


示例8: verifyPlayMediaOnTheWebOSV4WithoutDlna

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private void verifyPlayMediaOnTheWebOSV4WithoutDlna(MediaInfo mediaInfo, boolean shouldLoop) throws JSONException {
    Mockito.when(serviceDescription.getVersion()).thenReturn("4.0.0");
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);

    service.playMedia(mediaInfo, shouldLoop, listener);

    ArgumentCaptor<ServiceCommand> argCommand = ArgumentCaptor.forClass(ServiceCommand.class);
    Mockito.verify(socket).sendCommand(argCommand.capture());

    ServiceCommand command = argCommand.getValue();
    JSONObject payload = (JSONObject) command.getPayload();

    Assert.assertEquals("ssap://media.viewer/open", command.getTarget());
    Assert.assertEquals(mediaInfo.getUrl(), payload.getString("target"));
    Assert.assertEquals(mediaInfo.getTitle(), payload.getString("title"));
    Assert.assertEquals(mediaInfo.getDescription(), payload.getString("description"));
    Assert.assertEquals(mediaInfo.getMimeType(), payload.getString("mimeType"));
    Assert.assertEquals(shouldLoop, payload.getBoolean("loop"));

    Assert.assertEquals(mediaInfo.getImages().get(0).getUrl(), payload.getString("iconSrc"));
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:22,代码来源:WebOSTVServiceTest.java


示例9: verifyPlayMediaOnTheWebOSV4

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private void verifyPlayMediaOnTheWebOSV4(MediaInfo mediaInfo, boolean shouldLoop) {
    Mockito.when(serviceDescription.getVersion()).thenReturn("4.0.0");
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);

    DLNAService dlnaService = injectDLNAService();
    MediaPlayer mediaPlayer = Mockito.mock(MediaPlayer.class);
    Mockito.when(dlnaService.getAPI(MediaPlayer.class)).thenReturn(mediaPlayer);

    service.playMedia(mediaInfo, shouldLoop, listener);

    ArgumentCaptor<MediaInfo> argMediaInfo = ArgumentCaptor.forClass(MediaInfo.class);
    ArgumentCaptor<Boolean> argShouldLoop = ArgumentCaptor.forClass(Boolean.class);
    Mockito.verify(mediaPlayer).playMedia(argMediaInfo.capture(), argShouldLoop.capture(),
            Mockito.same(listener));

    MediaInfo capturedMediaInfo = argMediaInfo.getValue();
    Assert.assertEquals(mediaInfo.getDescription(), capturedMediaInfo.getDescription());
    Assert.assertEquals(mediaInfo.getMimeType(), capturedMediaInfo.getMimeType());
    Assert.assertEquals(mediaInfo.getTitle(), capturedMediaInfo.getTitle());
    Assert.assertEquals(mediaInfo.getUrl(), capturedMediaInfo.getUrl());
    Assert.assertEquals(mediaInfo.getImages(), capturedMediaInfo.getImages());
    Assert.assertEquals(mediaInfo.getSubtitleInfo(), capturedMediaInfo.getSubtitleInfo());
    Assert.assertEquals(shouldLoop, argShouldLoop.getValue().booleanValue());
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:25,代码来源:WebOSTVServiceTest.java


示例10: verifyPlayMediaOnTheLatestWebOS

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private void verifyPlayMediaOnTheLatestWebOS(MediaInfo mediaInfo, boolean shouldLoop, MediaPlayer.LaunchListener listener, WebOSWebAppSession webAppSession) {
    // should try to join to the web app
    ArgumentCaptor<ResponseListener> argListener = ArgumentCaptor.forClass(ResponseListener
            .class);
    Mockito.verify(webAppSession).join(argListener.capture());

    // run join success
    ResponseListener webAppListener = argListener.getValue();
    webAppListener.onSuccess(null);
    Robolectric.runUiThreadTasksIncludingDelayedTasks();

    // should delegate playing media to the WebAppSession
    ArgumentCaptor<MediaInfo> argMediaInfo = ArgumentCaptor.forClass(MediaInfo.class);
    ArgumentCaptor<Boolean> argShouldLoop = ArgumentCaptor.forClass(Boolean.class);
    Mockito.verify(webAppSession).playMedia(argMediaInfo.capture(), argShouldLoop.capture(),
            Mockito.same(listener));

    MediaInfo capturedMediaInfo = argMediaInfo.getValue();
    Assert.assertEquals(mediaInfo.getDescription(), capturedMediaInfo.getDescription());
    Assert.assertEquals(mediaInfo.getMimeType(), capturedMediaInfo.getMimeType());
    Assert.assertEquals(mediaInfo.getTitle(), capturedMediaInfo.getTitle());
    Assert.assertEquals(mediaInfo.getUrl(), capturedMediaInfo.getUrl());
    Assert.assertEquals(mediaInfo.getImages(), capturedMediaInfo.getImages());
    Assert.assertEquals(mediaInfo.getSubtitleInfo(), capturedMediaInfo.getSubtitleInfo());
    Assert.assertEquals(shouldLoop, argShouldLoop.getValue().booleanValue());
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:27,代码来源:WebOSTVServiceTest.java


示例11: updateCapabilities

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();
    capabilities.add(MediaPlayer.MediaInfo_Get);
    capabilities.add(MediaPlayer.Display_Image);
    capabilities.add(MediaPlayer.Play_Audio);
    capabilities.add(MediaPlayer.Play_Video);
    capabilities.add(MediaPlayer.Close);
    capabilities.add(MediaPlayer.MetaData_MimeType);
    capabilities.add(MediaPlayer.MetaData_Thumbnail);
    capabilities.add(MediaPlayer.MetaData_Title);
    capabilities.add(MediaPlayer.Subtitles_Vtt);

    capabilities.add(MediaControl.Play);
    capabilities.add(MediaControl.Pause);
    capabilities.add(MediaControl.Stop);
    capabilities.add(MediaControl.Seek);
    capabilities.add(MediaControl.Duration);
    capabilities.add(MediaControl.Position);
    capabilities.add(MediaControl.PlayState);
    capabilities.add(MediaControl.PlayState_Subscribe);

    setCapabilities(capabilities);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:25,代码来源:FireTVService.java


示例12: getPriorityLevel

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(VolumeControl.class)) {
        return getVolumeControlCapabilityLevel();
    }
    else if (clazz.equals(PlaylistControl.class)) {
        return getPlaylistControlCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:17,代码来源:DLNAService.java


示例13: displayImage

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public void displayImage(MediaInfo mediaInfo, MediaPlayer.LaunchListener listener) {
    String mediaUrl = null;
    String mimeType = null;
    String title = null;
    String desc = null;
    String iconSrc = null;

    if (mediaInfo != null) {
        mediaUrl = mediaInfo.getUrl();
        mimeType = mediaInfo.getMimeType();
        title = mediaInfo.getTitle();
        desc = mediaInfo.getDescription();

        if (mediaInfo.getImages() != null && mediaInfo.getImages().size() > 0) {
            ImageInfo imageInfo = mediaInfo.getImages().get(0);
            iconSrc = imageInfo.getUrl();
        }
    }

    displayImage(mediaUrl, mimeType, title, desc, iconSrc, listener);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:23,代码来源:WebOSWebAppSession.java


示例14: getPriorityLevel

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(Launcher.class)) {
        return getLauncherCapabilityLevel();
    }
    else if (clazz.equals(TextInputControl.class)) {
        return getTextInputControlCapabilityLevel();
    }
    else if (clazz.equals(KeyControl.class)) {
        return getKeyControlCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:20,代码来源:RokuService.java


示例15: updateCapabilities

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();

    Collections.addAll(capabilities, MediaPlayer.Capabilities);
    capabilities.add(Subtitle_WebVTT);


    Collections.addAll(capabilities, VolumeControl.Capabilities);

    capabilities.add(Play);
    capabilities.add(Pause);
    capabilities.add(Stop);
    capabilities.add(Duration);
    capabilities.add(Seek);
    capabilities.add(Position);
    capabilities.add(PlayState);
    capabilities.add(PlayState_Subscribe);

    capabilities.add(WebAppLauncher.Launch);
    capabilities.add(Message_Send);
    capabilities.add(Message_Receive);
    capabilities.add(Message_Send_JSON);
    capabilities.add(Message_Receive_JSON);
    capabilities.add(WebAppLauncher.Connect);
    capabilities.add(WebAppLauncher.Disconnect);
    capabilities.add(WebAppLauncher.Join);
    capabilities.add(WebAppLauncher.Close);

    setCapabilities(capabilities);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:32,代码来源:CastService.java


示例16: verifyPlayMediaWhenCastThrowsException

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private void verifyPlayMediaWhenCastThrowsException(Class<? extends Throwable> exception) throws CastService.CastClientException {
    MediaInfo mediaInfo = new MediaInfo.Builder("http://host.com/", "video/mp4").build();
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);
    Mockito.when(castClient.getApplicationStatus(Mockito.any(GoogleApiClient.class)))
            .thenThrow(exception);

    service.playMedia(mediaInfo, true, listener);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:9,代码来源:CastServiceTest.java


示例17: verifyPlayMedia

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
private com.google.android.gms.cast.MediaInfo verifyPlayMedia(MediaInfo mediaInfo) throws CastService.CastClientException {
    setServiceConnected();
    MediaPlayer.LaunchListener listener = Mockito.mock(MediaPlayer.LaunchListener.class);
    PendingResult<Cast.ApplicationConnectionResult> pendingResult
            = Mockito.mock(PendingResult.class);
    Mockito.when(castClient.launchApplication(Mockito.any(GoogleApiClient.class),
                    Mockito.anyString(), Mockito.any(LaunchOptions.class)))
            .thenReturn(pendingResult);


    // playMedia
    service.playMedia(mediaInfo, false, listener);
    Robolectric.runUiThreadTasksIncludingDelayedTasks();

    // CastApi.launchApplication
    Mockito.verify(castClient).launchApplication(Mockito.same(googleApiClient), Mockito.anyString(), Mockito.any(LaunchOptions.class));

    // ResultCallback.setResultCallback
    ArgumentCaptor<ResultCallback> argResultCallback =
            ArgumentCaptor.forClass(ResultCallback.class);
    Mockito.verify(pendingResult).setResultCallback(argResultCallback.capture());

    // ApplicationConnectionResultCallback.onResult
    ResultCallback resultCallback = argResultCallback.getValue();
    Cast.ApplicationConnectionResult result = Mockito.mock(Cast.ApplicationConnectionResult.class);
    Status status = Mockito.mock(Status.class);
    Mockito.when(status.isSuccess()).thenReturn(Boolean.TRUE);
    Mockito.when(result.getStatus()).thenReturn(status);
    ApplicationMetadata applicationMetadata = Mockito.mock(ApplicationMetadata.class);
    Mockito.when(result.getApplicationMetadata()).thenReturn(applicationMetadata);
    resultCallback.onResult(result);
    Robolectric.runUiThreadTasksIncludingDelayedTasks();

    // loadMedia
    ArgumentCaptor<com.google.android.gms.cast.MediaInfo> argMedia =
            ArgumentCaptor.forClass(com.google.android.gms.cast.MediaInfo.class);
    Mockito.verify(mediaPlayer).load(Mockito.same(googleApiClient), argMedia.capture(), Mockito.eq(true));
    return argMedia.getValue();
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:40,代码来源:CastServiceTest.java


示例18: closeLaunchSession

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
/**
 * Closes the session on the first screen device. Depending on the sessionType, the associated service will have different ways of handling the close functionality.
 *
 * @param launchSession LaunchSession to close
 * @param listener (optional) listener to be called on success/failure
 */
public void closeLaunchSession(LaunchSession launchSession, ResponseListener<Object> listener) {
    if (launchSession == null) {
        Util.postError(listener, new ServiceCommandError(0, "You must provide a valid LaunchSession", null));
        return;
    }

    DeviceService service = launchSession.getService();
    if (service == null) {
        Util.postError(listener, new ServiceCommandError(0, "There is no service attached to this launch session", null));
        return;
    }

    switch (launchSession.getSessionType()) {
    case App:
        if (service instanceof Launcher)
            ((Launcher) service).closeApp(launchSession, listener);
        break;
    case Media:
        if (service instanceof MediaPlayer)
            ((MediaPlayer) service).closeMedia(launchSession, listener);
        break;
    case ExternalInputPicker:
        if (service instanceof ExternalInputControl)
            ((ExternalInputControl) service).closeInputPicker(launchSession, listener);
        break;
    case WebApp:
        if (service instanceof WebAppLauncher)
            ((WebAppLauncher) service).closeWebApp(launchSession, listener);
        break;
    case Unknown:
    default:
        Util.postError(listener, new ServiceCommandError(0, "This DeviceService does not know ho to close this LaunchSession", null));
        break;
    }
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:42,代码来源:DeviceService.java


示例19: getPriorityLevel

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(Launcher.class)) {
        return getLauncherCapabilityLevel();
    }
    else if (clazz.equals(TVControl.class)) {
        return getTVControlCapabilityLevel();
    }
    else if (clazz.equals(VolumeControl.class)) {
        return getVolumeControlCapabilityLevel();
    }
    else if (clazz.equals(ExternalInputControl.class)) {
        return getExternalInputControlPriorityLevel();
    }
    else if (clazz.equals(MouseControl.class)) {
        return getMouseControlCapabilityLevel();
    }
    else if (clazz.equals(TextInputControl.class)) {
        return getTextInputControlCapabilityLevel();
    }
    else if (clazz.equals(PowerControl.class)) {
        return getPowerControlCapabilityLevel();
    }
    else if (clazz.equals(KeyControl.class)) {
        return getKeyControlCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:35,代码来源:NetcastTVService.java


示例20: playMedia

import com.connectsdk.service.capability.MediaPlayer; //导入依赖的package包/类
@Override
public void playMedia(MediaInfo mediaInfo, boolean shouldLoop, final MediaPlayer.LaunchListener listener) {
    if (getDLNAService() != null) {
        final MediaPlayer.LaunchListener launchListener = new LaunchListener() {

            @Override
            public void onError(ServiceCommandError error) {
                if (listener != null)
                    Util.postError(listener, error);
            }

            @Override
            public void onSuccess(MediaLaunchObject object) {
                object.launchSession.setAppId(SMART_SHARE);
                object.launchSession.setAppName(SMART_SHARE);

                object.mediaControl = NetcastTVService.this.getMediaControl();

                if (listener != null)
                    Util.postSuccess(listener, object);
            }
        };

        getDLNAService().playMedia(mediaInfo, shouldLoop, launchListener);
    }
    else {
        System.err.println("DLNA Service is not ready yet");
    }
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:30,代码来源:NetcastTVService.java



注:本文中的com.connectsdk.service.capability.MediaPlayer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConnectionHandshakeException类代码示例发布时间:2022-05-23
下一篇:
Java ConversationAbandonedListener类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap