Tazwar Utshas
Tazwar Utshas

Reputation: 961

How to show Vimeo Videos in Android Webview?

Let's say, this is the link I'm using to show in android webview using KOTLIN. But, Only a blank page is coming. https://vimeo.com/user92933894/review/307846259/0b380ce589 Now, here is my code:

var url = intent.getStringExtra("link")
        println(url)
        val videoPreferences = VideoPreferences(this)
        val pointPreferences = PointPrefernce(this)

        var videoIds = videoPreferences.getVideoId()


        paidvideo.settings.javaScriptEnabled=true
        paidvideo.settings.setSupportZoom(true)
        paidvideo.webViewClient = object : WebViewClient(){

        }
        paidvideo.loadUrl(url)

Here the url is getting the link as extras of an intent. And the link is coming perfectly. And youtube link is working perfectly, but not the vimeo's one. BTW, I don't need autoplay option.

Upvotes: 1

Views: 307

Answers (1)

Tazwar Utshas
Tazwar Utshas

Reputation: 961

At last I found the answer. Actually, here "Uncaught TypeError: Cannot call method 'getItem' of null" error happened. and to solve this error, I needed to add this following line.

paidvideo.settings.domStorageEnabled = true

making domStorageEnabled true solves the problem.

Upvotes: 1

Related Questions