我将外部(Vimeo).mp4加载到Ionic Framework应用程序中的标准HTML5视频标记中,除了在iOS上工作正常:
Vimeo的外部链接(例如https://player.vimeo.com/external/
)转发到https://gcs-vimeo.akamaized.net
地址,因为他们描述了here。
在iOS上,初始加载是从Source: Disk Cache
加载的。但是,当离开此页面或停止并尝试重播视频时,它会返回Status: 304 Not Modified
响应,因为它希望视频再次从缓存中加载。但是,在应用程序中,视频没有从缓存加载,我只是得到一个破碎的播放器(找不到源)。
视频标签看起来像这样:
<div class="player">
<video class="player__video viewer toggle" #exerciseVideo [src]="exercise.video | vimeoVideoUrl | safe:'resourceUrl'" [poster]="exercise.images[0] | awsImageUrl:'medium' | safe:'resourceUrl'" controls playsinline loop tappable></video>
</div>
有关如何在第二次播放(理想情况下)从缓存加载它的任何帮助,或者每次如何强制提出新的网络请求都将非常感激。
答案 0 :(得分:0)
我已经尝试了一切,包括以下帖子:
iOS: bug in AVPlayerItem when receiving `304 Not Modified` response
Embedded HTML 5 video is stored in the cache but is not displayed on iPad 2
但是要使它在iOS上正常运行,我必须实现的绝对核选项是附加from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
cluster = ['Line a baking pan with a sheet of parchment paper.',
'Line the cake pan with parchment paper.',
'Line the bottom with parchment paper.',
'Line a baking pan with parchment paper.']
corpus = ['Add vinegar and sugar.',
'Remove pan from heat and let stand 5 minutes.',
'Line the pan with parchment paper.']
# Train tfidf on cluster
tfidf = TfidfVectorizer()
tfidf_cluster = tfidf.fit_transform(cluster)
# Tranform the corpus using the trained tfidf
tfidf_corpus = tfidf.transform(corpus)
# Cosine similarity
cos_similarity = np.dot(tfidf_corpus, tfidf_cluster.T).A
avg_similarity = np.mean(cos_similarity, axis=1)
cos_similarity
Out[271]:
array([[0. , 0. , 0. , 0. ],
[0.31452723, 0.36145869, 0. , 0.43855558],
[0.50673521, 0.8242027 , 0.7139548 , 0.70655744]])
avg_similarity
Out[272]: array([0. , 0.27863537, 0.68786254])
以以下代码为例完成:
?time-in-milliseconds
欢迎其他任何反馈。