WebViews对Android的谷歌阅读器式的优化

编程入门 行业动态 更新时间:2024-10-25 20:20:01
本文介绍了WebViews对Android的谷歌阅读器式的优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个应用程序显示在一个web视图一篇博客文章的HTML。但图像,都相当大,不适合在屏幕上。当观看帖子在Android谷歌阅读器应用程序,但是,所有的图像都有其宽度减小到适合屏幕。

I have an app that displays the html of a blog post in a WebView. The images, however, are rather large and do not fit to the screen. When viewing the post in the Android Google Reader app, however, all of the images have their width reduced to fit the screen.

Android的谷歌阅读器也将分析出所有嵌入YouTube和Vimeo的嵌入,并与缩略图的链接替换这样的专用YouTube播放器可以播放视频,而不是。

The Android Google Reader will also parse out all embedded Youtube and Vimeo embeds and replace them with thumbnails with links so the dedicated Youtube player can play the video instead.

我怎么会去这样做呢?我已经使用Jsoup来匹配后的所有图像,并改变它们的宽度试过,但我不知道如何去修改的YouTube视频嵌入。

How would I go about doing this? I've tried using Jsoup to match all the images in a post and alter their width, but I don't know how to go about modifying the Youtube video embeds.

推荐答案

有关转换嵌入YouTube视频缩略图,你可以用mobitube.js code从的 Mobilize.js项目:

For converting embed Youtube videos to thumbnails you can do it with mobitube.js code from Mobilize.js project:

github/mobilizejs/mobilize。 JS / BLOB /主/ JS / mobitube.js

此外,我认为,谷歌阅读器只需使用CSS覆盖调整大小的图像。

Also I believe Google Reader simply resizes the images using CSS overrides.

Mobilize.js也有工具来重写图像标记,并执行去浮的操作对他们来说:

Mobilize.js has also tools for rewriting image tags and perform "de-float" operation for them:

github/mobilizejs/ mobilize.js / BLOB /主/ JS / mobilize.js#L2005

更多关于defloat算法中:

More about defloat algo:

webandmobile.mfabrik/docs/网络和移动/用户手册/调整

如果你想调整在服务器端的图像,这是一个第三方的解决方案:

If you want to resize images on the server-side this is a third party solution:

adaptive-images/

...虽然从从头开始编写自己的图像大小调整代理服务器是不是具有挑战性。

... though writing your own image resize proxy server from the scratch is not that challenging.

更多推荐

WebViews对Android的谷歌阅读器式的优化

本文发布于:2023-07-15 23:10:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1115322.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阅读器   WebViews   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!