Android Open Source - Jupiter-Broadcasting-Holo I Media Auth Service






From Project

Back to project page Jupiter-Broadcasting-Holo.

License

The source code is released under:

Copyright (c) 2011 Shane Quigley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...

If you think the Android project Jupiter-Broadcasting-Holo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Google Inc. All Rights Reserved.
 *//w  w w.j a  va 2 s.c o m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.sample.castcompanionlibrary.cast.player;

import com.google.android.gms.cast.MediaInfo;

/**
 * A public interface if an application requires a pre-authorization of a media, prior to its
 * playback. Applications should implement this interface when they want to obtain a
 * pre-authorization prior to calling the {@link VideoCastControllerActivity}. The implementation
 * should prepare the stage for its own out-of-bound process but should not start that till the
 * {@link IMediaAuthService#start()} is called by the CCL library. Applications should provide a
 * timeout limit to make sure that this out-of-bound process is completed within a reasonable period
 * of time.
 * <p/>
 * Framework passes an {@link IMediaAuthListener} to the implementation of this interface to provide
 * a way for the implementation to callback to the framework with its results. When the
 * authorization process ends, the implementation has to call {@link IMediaAuthListener#onResult()}
 * with the relevant results; whether the authorization was granted or rejected. If, however, the
 * process encounters an unrecoverable error, it has to call the
 * {@link IMediaAuthListener#onFailure()} callback of the {@link IMediaAuthListener} to inform the
 * framework.
 * <p/>
 * If the library decides to to interrupt the authorization process (say, a user decides to
 * interrupt the process or if it times out), it will call {@link IMediaAuthService#abort()} and
 * provides a reason. Implementation has to make sure that it will not call any of the framework
 * callbacks after it has received an abort message.
 * <p/>
 * Since authorization process can be involved and may require network access, the
 * {@link IMediaAuthService#start()} method is called on a non-UI thread. Callbacks into the
 * framework can happen on or off the UI thread.
 */
public interface IMediaAuthService {

    /**
     * Starts the authorization process. Before this call, it is assumed that the implementor has
     * all the information required to perform the authorization task. This is where the dynamic
     * life cycle of this class starts.
     */
    public void start();

    /**
     * Registers an {@link IMediaAuthListener} listener to be notified when the authentication
     * service has obtained its result. To remove a previously set listener, pass a
     * <code>null</code> argument.
     *
     * @param listener
     */
    public void setOnResult(IMediaAuthListener listener);

    /**
     * Returns the current {@link MediaInfo} object that is the subject of authorization. At a
     * minimum, it is expected to have images for the media at any stage.
     *
     * @return
     */
    public MediaInfo getMediaInfo();

    /**
     * In pending state, implementors can provide an optional localized message to be shown to the
     * user. If <code>null</code> is returned, no message will be shown to the user.
     *
     * @return
     */
    public String getPendingMessage();

    /**
     * Returns the current status of the service.
     *
     * @return
     */
    public MediaAuthStatus getStatus();

    /**
     * Returns the length of time within which the library expects to have heard back from the
     * authorization service. If it doesn't, it will call {@link abort()}.
     *
     * @return Timeout in milliseconds
     */
    public long getTimeout();

    /**
     * If authorization times out or user cancels the authorization process, this method will be
     * called.
     *
     * @param abortReason One of the {@link MediaAuthStatus#ABORT_*} reasons
     */
    public void abort(MediaAuthStatus abortReason);

}




Java Source Code List

com.google.sample.castcompanionlibrary.cast.BaseCastManager.java
com.google.sample.castcompanionlibrary.cast.CastMediaRouterCallback.java
com.google.sample.castcompanionlibrary.cast.DataCastManager.java
com.google.sample.castcompanionlibrary.cast.DeviceSelectionListener.java
com.google.sample.castcompanionlibrary.cast.VideoCastManager.java
com.google.sample.castcompanionlibrary.cast.callbacks.BaseCastConsumerImpl.java
com.google.sample.castcompanionlibrary.cast.callbacks.DataCastConsumerImpl.java
com.google.sample.castcompanionlibrary.cast.callbacks.IBaseCastConsumer.java
com.google.sample.castcompanionlibrary.cast.callbacks.IDataCastConsumer.java
com.google.sample.castcompanionlibrary.cast.callbacks.IVideoCastConsumer.java
com.google.sample.castcompanionlibrary.cast.callbacks.VideoCastConsumerImpl.java
com.google.sample.castcompanionlibrary.cast.dialog.video.VideoMediaRouteControllerDialogFragment.java
com.google.sample.castcompanionlibrary.cast.dialog.video.VideoMediaRouteControllerDialog.java
com.google.sample.castcompanionlibrary.cast.dialog.video.VideoMediaRouteDialogFactory.java
com.google.sample.castcompanionlibrary.cast.exceptions.CastException.java
com.google.sample.castcompanionlibrary.cast.exceptions.NoConnectionException.java
com.google.sample.castcompanionlibrary.cast.exceptions.OnFailedListener.java
com.google.sample.castcompanionlibrary.cast.exceptions.TransientNetworkDisconnectionException.java
com.google.sample.castcompanionlibrary.cast.player.IMediaAuthListener.java
com.google.sample.castcompanionlibrary.cast.player.IMediaAuthService.java
com.google.sample.castcompanionlibrary.cast.player.IVideoCastController.java
com.google.sample.castcompanionlibrary.cast.player.MediaAuthStatus.java
com.google.sample.castcompanionlibrary.cast.player.OnVideoCastControllerListener.java
com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerActivity.java
com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerFragment.java
com.google.sample.castcompanionlibrary.notification.VideoCastNotificationService.java
com.google.sample.castcompanionlibrary.remotecontrol.RemoteControlClientCompat.java
com.google.sample.castcompanionlibrary.remotecontrol.RemoteControlHelper.java
com.google.sample.castcompanionlibrary.remotecontrol.VideoIntentReceiver.java
com.google.sample.castcompanionlibrary.utils.LogUtils.java
com.google.sample.castcompanionlibrary.utils.Utils.java
com.google.sample.castcompanionlibrary.widgets.IMiniController.java
com.google.sample.castcompanionlibrary.widgets.MiniController.java
jupiter.broadcasting.live.holo.CatalogueAdapter.java
jupiter.broadcasting.live.holo.Catalogue.java
jupiter.broadcasting.live.holo.EpisodeAdapter.java
jupiter.broadcasting.live.holo.EpisodeListFragment.java
jupiter.broadcasting.live.holo.Home.java
jupiter.broadcasting.live.holo.JBApplication.java
jupiter.broadcasting.live.holo.JBPlayer.java
jupiter.broadcasting.live.holo.MySpinnerAdapter.java
jupiter.broadcasting.live.holo.SettingsActivity.java
jupiter.broadcasting.live.holo.ShowActivity.java
jupiter.broadcasting.live.holo.ShowNotesView.java
jupiter.broadcasting.live.holo.list.BitmapLruCache.java
jupiter.broadcasting.live.holo.list.FadeImageView.java
jupiter.broadcasting.live.holo.parser.RssHandler.java
jupiter.broadcasting.live.holo.parser.SaxRssParser.java