mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 16:20:27 +08:00
Enhancement: twitter animated_gif autoplay (#1426)
- `media.type` 为 `animated_gif` 时自动循环播放视频,普通视频(`video`)维持原状 - 具体表现与阅读器(或者说是浏览器内核)有关,有些确实不支持自动播放,可以参考[这个](https://imququ.com/post/new-video-policies-for-ios10.html) - Closes #1421
This commit is contained in:
@@ -36,7 +36,8 @@ const ProcessFeed = ({ data = [] }) => {
|
|||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
if (video.url) {
|
if (video.url) {
|
||||||
content = `<br><video src="${video.url}" controls="controls" poster="${getOrigionImg(media.media_url_https)}" style="width: 100%"></video>`;
|
const gifAutoPlayAttr = media.type === 'animated_gif' ? `autoplay loop muted webkit-playsinline playsinline` : '';
|
||||||
|
content = `<br><video src="${video.url}" ${gifAutoPlayAttr} controls="controls" poster="${getOrigionImg(media.media_url_https)}" style="width: 100%"></video>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
|
|||||||
Reference in New Issue
Block a user