Embed video in html file loaded in UIWebView from Documents folder of application

后端 未结 5 2082
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 10:23

I have an html file named videoplay.html with following content




    Title         


        
5条回答
  •  一整个雨季
    2021-02-13 10:53

    One trick to get local content to show up in UIWebView is to use a substitution cache. Matt Gallagher has some sample code up on his blog.

    Basically you assign an URL to the movie, say "http://www.example.com/movie.mp4", which you use in your HTML to refer to the movie. When the movie is loaded, instead of going to the URL, the substitution cache fetches the data locally.

    AFAIK this works with all iOS versions.

提交回复
热议问题