Skip to content

Commit

Permalink
Update MainActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
prateek-chaubey authored Jun 25, 2024
1 parent 98a6725 commit 2aa09d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected void onCreate(Bundle savedInstanceState) {
load(false);
}
public void load(boolean dl) {
boolean dL=dl;
if (Build.VERSION.SDK_INT > 22 && Build.VERSION.SDK_INT < 28 && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
Toast.makeText(getApplicationContext(), getString(R.string.grant_storage), Toast.LENGTH_SHORT).show();
requestPermissions(new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
Expand Down Expand Up @@ -80,9 +81,9 @@ public void onPageFinished(WebView p1, String url) {

web.loadUrl("javascript:(function () { var script = document.createElement('script'); script.src='https://cdn.jsdelivr.net/npm/ytpro'; document.body.appendChild(script); })();");
web.loadUrl("javascript:(function () { var script = document.createElement('script'); script.src='https://cdn.jsdelivr.net/npm/ytpro/bgplay.js'; document.body.appendChild(script); })();");
if(dl){
if(dL){
web.loadUrl("javascript:(function () {window.location.hash='download';})();");
dl=false;
dL=false;
}
if(!url.contains("#bgplay") && isPlaying){
isPlaying=false;
Expand Down

0 comments on commit 2aa09d8

Please sign in to comment.