File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed 
src/main/java/com/lizongying/mytv Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,13 @@ dependencies {
100100    //  For HLS playback support with ExoPlayer
101101    implementation " androidx.media3:media3-exoplayer-hls:$media3_version  " 
102102
103+     //  21:2.9.0 17:2.6.4
104+     def  retrofit2_version =  " 2.9.0" 
105+ 
103106    implementation ' com.google.protobuf:protobuf-kotlin:3.25.1' 
104-     implementation ' com.squareup.retrofit2:converter-gson:2.9.0 ' 
105-     implementation ' com.squareup.retrofit2:converter-protobuf:2.9.0 ' 
106-     implementation ' com.squareup.retrofit2:retrofit:2.9.0 ' 
107+     implementation " com.squareup.retrofit2:converter-gson:$r etrofit2_version " 
108+     implementation " com.squareup.retrofit2:converter-protobuf:$r etrofit2_version " 
109+     implementation " com.squareup.retrofit2:retrofit:$r etrofit2_version " 
107110    implementation " org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2" 
108111    implementation ' androidx.core:core-ktx:1.11.0-beta02' 
109112    implementation ' androidx.leanback:leanback:1.2.0-alpha02' 
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class PlayerFragment : Fragment() {
2424    private  var  _binding :  PlayerBinding ?  =  null 
2525    private  var  playerView:  PlayerView ?  =  null 
2626    private  var  tvViewModel:  TVViewModel ?  =  null 
27+     private  val  aspectRatio =  16f  /  9f 
2728
2829    override  fun  onCreateView (
2930        inflater :  LayoutInflater , container :  ViewGroup ? ,
@@ -43,10 +44,9 @@ class PlayerFragment : Fragment() {
4344                playerView!! .player?.playWhenReady =  true 
4445                playerView!! .player?.addListener(object  :  Player .Listener  {
4546                    override  fun  onVideoSizeChanged (videoSize :  VideoSize ) {
46-                         val  aspectRatio =  16f  /  9f 
47-                         val  layoutParams =  playerView?.layoutParams
4847                        val  ratio =  playerView?.measuredWidth?.div(playerView?.measuredHeight!! )
4948                        if  (ratio !=  null ) {
49+                             val  layoutParams =  playerView?.layoutParams
5050                            if  (ratio <  aspectRatio) {
5151                                layoutParams?.height = 
5252                                    (playerView?.measuredWidth?.div(aspectRatio))?.toInt()
Original file line number Diff line number Diff line change @@ -169,8 +169,7 @@ class Request {
169169            .enqueue(object  :  Callback <Info > {
170170                override  fun  onResponse (call :  Call <Info >, response :  Response <Info >) {
171171                    if  (response.isSuccessful) {
172-                         val  info =  response.body()
173-                         val  token =  info?.data?.token
172+                         val  token =  response.body()?.data?.token
174173                        Log .i(TAG , " info success $token " 
175174                        val  cookie = 
176175                            " guid=1; vplatform=109; yspopenid=vu0-8lgGV2LW9QjDeuBFsX8yMnzs37Q3_HZF6XyVDpGR_I; vusession=$token " 
Original file line number Diff line number Diff line change 11package  com.lizongying.mytv.models 
22
3- import  android.content.SharedPreferences 
43import  androidx.lifecycle.LiveData 
54import  androidx.lifecycle.MutableLiveData 
65import  androidx.lifecycle.ViewModel 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments