Home | History | Annotate | Download | only in ui
      1 /*
      2  * Copyright (C) 2018 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License
     15  */
     16 
     17 package com.android.tv.ui;
     18 
     19 /** API to play pause and set the volume of a TunableTvView */
     20 public interface TunableTvViewPlayingApi {
     21 
     22     boolean isPlaying();
     23 
     24     void setStreamVolume(float volume);
     25 
     26     void setTimeShiftListener(TimeShiftListener listener);
     27 
     28     boolean isTimeShiftAvailable();
     29 
     30     void timeshiftPlay();
     31 
     32     void timeshiftPause();
     33 
     34     void timeshiftRewind(int speed);
     35 
     36     void timeshiftFastForward(int speed);
     37 
     38     void timeshiftSeekTo(long timeMs);
     39 
     40     long timeshiftGetCurrentPositionMs();
     41 
     42     /** Used to receive the time-shift events. */
     43     abstract class TimeShiftListener {
     44         /**
     45          * Called when the availability of the time-shift for the current channel has been changed.
     46          * It should be guaranteed that this is called only when the availability is really changed.
     47          */
     48         public abstract void onAvailabilityChanged();
     49 
     50         /**
     51          * Called when the record start time has been changed. This is not called when the recorded
     52          * programs is played.
     53          */
     54         public abstract void onRecordStartTimeChanged(long recordStartTimeMs);
     55     }
     56 }
     57