本文整理汇总了Java中com.google.android.gms.cast.LaunchOptions类的典型用法代码示例。如果您正苦于以下问题:Java LaunchOptions类的具体用法?Java LaunchOptions怎么用?Java LaunchOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LaunchOptions类属于com.google.android.gms.cast包,在下文中一共展示了LaunchOptions类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CastConfiguration
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
private CastConfiguration(Builder builder) {
if (builder.mDebugEnabled) {
mCapabilities |= FEATURE_DEBUGGING;
}
if (builder.mLockScreenEnabled) {
mCapabilities |= FEATURE_LOCKSCREEN;
}
if (builder.mNotificationEnabled) {
mCapabilities |= FEATURE_NOTIFICATION;
}
if (builder.mWifiReconnectEnabled) {
mCapabilities |= FEATURE_WIFI_RECONNECT;
}
if (builder.mCaptionPreferenceEnabled) {
mCapabilities |= FEATURE_CAPTIONS_PREFERENCE;
}
if (builder.mAutoReconnectEnabled) {
mCapabilities |= FEATURE_AUTO_RECONNECT;
}
mNotificationActions = new ArrayList<>(builder.mNotificationActions);
mNotificationCompactActions = new ArrayList<>(builder.mNotificationCompactActions);
mNextPrevVisibilityPolicy = builder.mNextPrevVisibilityPolicy;
mApplicationId = builder.mApplicationId;
mTargetActivity = builder.mTargetActivity;
if (!builder.mNamespaces.isEmpty()) {
mNamespaces = new ArrayList<>(builder.mNamespaces);
}
if (builder.mLocale != null) {
mLaunchOptions = new LaunchOptions.Builder().setLocale(builder.mLocale)
.setRelaunchIfRunning(builder.mRelaunchIfRunning).build();
} else {
mLaunchOptions = new LaunchOptions.Builder().setRelaunchIfRunning(false).build();
}
mCastControllerImmersive = builder.mCastControllerImmersive;
mForwardStep = builder.mForwardStep;
mCustomNotificationService = builder.mCustomNotificationService;
mMediaRouteDialogFactory = builder.mMediaRouteDialogFactory;
mDisableLaunchOnConnect = builder.mDisableLaunchOnConnect;
}
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:40,代码来源:CastConfiguration.java
示例2: launchApplication
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
public PendingResult<ApplicationConnectionResult> launchApplication(
GoogleApiClient mApiClient, String mediaAppId, LaunchOptions options)
throws CastClientException {
try {
return Cast.CastApi.launchApplication(mApiClient, mediaAppId, options);
} catch (RuntimeException e) {
throw createCastClientException(e);
}
}
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:10,代码来源:CastService.java
示例3: verifyPlayMedia
import com.google.android.gms.cast.LaunchOptions; //导入依赖的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
示例4: a
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
protected void a(ecx paramecx)
{
try
{
String str = this.a;
LaunchOptions localLaunchOptions = this.b;
paramecx.a(this);
((edg)paramecx.l()).a(str, localLaunchOptions);
return;
}
catch (IllegalStateException localIllegalStateException)
{
a(2001);
}
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:16,代码来源:ebv.java
示例5: launchApplication
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
private PendingResult<Cast.ApplicationConnectionResult> launchApplication(
GoogleApiClient apiClient,
String appId,
boolean relaunchIfRunning) {
LaunchOptions.Builder builder = new LaunchOptions.Builder();
return Cast.CastApi.launchApplication(apiClient, appId,
builder.setRelaunchIfRunning(relaunchIfRunning)
.build());
}
开发者ID:mogoweb,项目名称:365browser,代码行数:10,代码来源:CreateRouteRequest.java
示例6: connectCastDevice
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
private void connectCastDevice(boolean forceRelaunch) {
final CastDevice selectedDevice = mCastDeviceHolder.getCastDevice();
Timber.d("acquiring a connection to Google Play services for %s", selectedDevice);
Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions.builder(selectedDevice, new CastListener())
.setVerboseLoggingEnabled(true);
mApiClient = new GoogleApiClient.Builder(mContext)
.addApi(Cast.API, apiOptionsBuilder.build())
//XXX will deadlock, instead we repost callbacks to the handler
// .setHandler(mCallbackHandler)
.build();
ConnectionResult res = mApiClient.blockingConnect();
if (!res.isSuccess()) {
stopWithError(res.getErrorMessage());
return;
}
String applicationId = mContext.getString(R.string.cast_id);
LaunchOptions.Builder launchOptions = new LaunchOptions.Builder()
.setRelaunchIfRunning(forceRelaunch);
Cast.ApplicationConnectionResult castRes;
int retries = 0;
do {
Timber.d("launching cast application try %d", retries);
castRes = Cast.CastApi.launchApplication(mApiClient, applicationId,
launchOptions.build()).await(30, TimeUnit.SECONDS);
launchOptions.setRelaunchIfRunning(false);
} while (!castRes.getStatus().isSuccess() && retries++ < 3);
if (!castRes.getStatus().isSuccess()) {
stopWithError(castRes.getStatus().getStatusMessage());
mSessionId = null;
return;
}
mSessionId = castRes.getSessionId();
attachMediaChannel();
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:35,代码来源:CastRendererService.java
示例7: getLaunchOptions
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
public LaunchOptions getLaunchOptions() {
return mLaunchOptions;
}
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:4,代码来源:CastConfiguration.java
示例8: a
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
public efk<ebo> a(efd paramefd, String paramString, LaunchOptions paramLaunchOptions)
{
return paramefd.b(new ebv(this, paramefd, paramString, paramLaunchOptions));
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:ebp.java
示例9: ebv
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
ebv(ebp paramebp, efd paramefd, String paramString, LaunchOptions paramLaunchOptions)
{
this(paramefd);
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:ebv.java
示例10: launchApplication
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
@Override
public PendingResult<Cast.ApplicationConnectionResult> launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions) {
return null;
}
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:5,代码来源:CastApiImpl.java
示例11: a
import com.google.android.gms.cast.LaunchOptions; //导入依赖的package包/类
public abstract void a(String paramString, LaunchOptions paramLaunchOptions);
开发者ID:ChiangC,项目名称:FMTech,代码行数:2,代码来源:edg.java
注:本文中的com.google.android.gms.cast.LaunchOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论