@@ -95,6 +95,11 @@ public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Con
95
95
web .loadUrl ("javascript:(function(){" +"setTimeout( () => {" +"document.getElementById('player-container-id').style.position='fixed';" +"document.getElementById('player-container-id').style.top='48px'; " +"document.getElementsByClassName('mobile-topbar-header')[0].style.display='flex'; " +"},50);})()" );
96
96
}
97
97
}
98
+ @ Override
99
+ protected void onUserLeaveHint () {
100
+ super .onUserLeaveHint ();
101
+ web .loadUrl ("javascript:PIPlayer();" );
102
+ }
98
103
99
104
100
105
@@ -159,18 +164,16 @@ public void onHideCustomView() {
159
164
160
165
}
161
166
162
- private void downloadFile (String filename , String url , String userAgent ) {
167
+ private void downloadFile (String filename , String url , String mtype ) {
163
168
try {
164
- String cookie = CookieManager .getInstance ().getCookie (url );
165
169
DownloadManager downloadManager = (DownloadManager ) getSystemService (DOWNLOAD_SERVICE );
166
170
DownloadManager .Request request = new DownloadManager .Request (Uri .parse (url ));
167
171
request .setTitle (filename )
168
- .setDescription ("Downloading..." )
169
- .addRequestHeader ("cookie" , cookie )
170
- .addRequestHeader ("User-Agent" , userAgent )
171
- .setMimeType ("video/mp4" )
172
+ .setDescription (filename )
173
+ .setMimeType (mtype )
172
174
.setAllowedOverMetered (true )
173
175
.setAllowedOverRoaming (true )
176
+ .setDestinationInExternalPublicDir (Environment .DIRECTORY_DOWNLOADS .toString (), filename )
174
177
.setNotificationVisibility (DownloadManager .Request .VISIBILITY_VISIBLE |
175
178
DownloadManager .Request .VISIBILITY_VISIBLE_NOTIFY_COMPLETED );
176
179
downloadManager .enqueue (request );
@@ -207,8 +210,8 @@ public void gohome(String fko) {
207
210
}
208
211
209
212
@ JavascriptInterface
210
- public void downvid (String namee ,String urll , String uaa ) {
211
- downloadFile (namee ,urll ,uaa );
213
+ public void downvid (String namee ,String urll , String m ) {
214
+ downloadFile (namee ,urll ,m );
212
215
}
213
216
@ JavascriptInterface
214
217
public void oplink (String urll ) {
0 commit comments