Home | History | Annotate | Download | only in media

Lines Matching defs:session

45 import android.support.v4.media.session.MediaSessionCompat;
46 import android.support.v4.media.session.PlaybackStateCompat;
127 throw new IllegalArgumentException("Ambiguous session type. Multiple"
128 + " session services define the same id=" + id);
957 throw new IllegalArgumentException("Ambiguous session type. Multiple"
958 + " session services define the same id=" + id);
1168 private MyPlayerEventCallback(MediaSession2ImplBase session) {
1169 mSession = new WeakReference<>(session);
1175 final MediaSession2ImplBase session = getSession();
1176 if (session == null) {
1179 session.getCallbackExecutor().execute(new Runnable() {
1188 item = MyPlayerEventCallback.this.getMediaItem(session, dsd);
1194 session.getCallback().onCurrentMediaItemChanged(session.getInstance(), player,
1196 session.notifyToAllControllers(new NotifyRunnable() {
1208 final MediaSession2ImplBase session = getSession();
1209 if (session == null || dsd == null) {
1212 session.getCallbackExecutor().execute(new Runnable() {
1215 MediaItem2 item = MyPlayerEventCallback.this.getMediaItem(session, dsd);
1219 if (item.equals(session.getCurrentMediaItem())) {
1220 long duration = session.getDuration();
1255 session.notifyToAllControllers(new NotifyRunnable() {
1259 session.getPlaylist(), session.getPlaylistMetadata());
1264 session.getCallback().onMediaPrepared(session.getInstance(), mpb, item);
1271 final MediaSession2ImplBase session = getSession();
1272 if (session == null) {
1275 session.getCallbackExecutor().execute(new Runnable() {
1278 session.getCallback().onPlayerStateChanged(
1279 session.getInstance(), player, state);
1280 session.notifyToAllControllers(new NotifyRunnable() {
1293 final MediaSession2ImplBase session = getSession();
1294 if (session == null || dsd == null) {
1297 session.getCallbackExecutor().execute(new Runnable() {
1300 final MediaItem2 item = MyPlayerEventCallback.this.getMediaItem(session, dsd);
1304 session.getCallback().onBufferingStateChanged(
1305 session.getInstance(), mpb, item, state);
1306 session.notifyToAllControllers(new NotifyRunnable() {
1318 final MediaSession2ImplBase session = getSession();
1319 if (session == null) {
1322 session.getCallbackExecutor().execute(new Runnable() {
1325 session.getCallback().onPlaybackSpeedChanged(session.getInstance(), mpb, speed);
1326 session.notifyToAllControllers(new NotifyRunnable() {
1338 final MediaSession2ImplBase session = getSession();
1339 if (session == null) {
1342 session.getCallbackExecutor().execute(new Runnable() {
1345 session.getCallback().onSeekCompleted(session.getInstance(), mpb, position);
1346 session.notifyToAllControllers(new NotifyRunnable() {
1357 final MediaSession2ImplBase session = mSession.get();
1358 if (session == null && DEBUG) {
1359 Log.d(TAG, "Session is closed", new IllegalStateException());
1361 return session;
1364 private MediaItem2 getMediaItem(MediaSession2ImplBase session, DataSourceDesc dsd) {
1365 MediaPlaylistAgent agent = session.getPlaylistAgent();
1368 Log.d(TAG, "Session is closed", new IllegalStateException());
1386 private MyPlaylistEventCallback(MediaSession2ImplBase session) {
1387 mSession = new WeakReference<>(session);
1393 final MediaSession2ImplBase session = mSession.get();
1394 if (session == null) {
1397 session.notifyPlaylistChangedOnExecutor(playlistAgent, list, metadata);
1403 final MediaSession2ImplBase session = mSession.get();
1404 if (session == null) {
1407 session.notifyPlaylistMetadataChangedOnExecutor(playlistAgent, metadata);
1412 final MediaSession2ImplBase session = mSession.get();
1413 if (session == null) {
1416 session.notifyRepeatModeChangedOnExecutor(playlistAgent, repeatMode);
1421 final MediaSession2ImplBase session = mSession.get();
1422 if (session == null) {
1425 session.notifyShuffleModeChangedOnExecutor(playlistAgent, shuffleMode);