play video and download using webview

I need javascript code to detect play button of video on web-page in web-view and start downloading on click of button in android web-view

I have used javascipt code to solve this issue it download video but didn't play in web-page stuck video play button in website

     page.loadUrl("javascript:(function prepareVideo() { "
                            + "var el = document.querySelectorAll('div[data-sigil]');"
                            + "for(var i=0;i<el.length; i++)"
                            + "{"
                            + "var sigil = el[i].dataset.sigil;"
                            + "if(sigil.indexOf('inlineVideo') > -1){"
                            + "delete el[i].dataset.sigil;"
                            + "console.log(i);"
                            + "var jsonData = JSON.parse(el[i];"
                            + "el[i].setAttribute('onclick', 'FBDownloader.processVideo(\"'+jsonData['src']+'\",\"'+jsonData['videoID']+'\");');"
                            + "}" + "}" + "})()");
                    page.loadUrl("javascript:( window.onload=prepareVideo;"
                            + ")()");

I need javascript code that when I click on video default button to play so video starts playing and by clicking on other button defined by me to start download file



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.