android - Ionic 3 - 无法在 iOS 手机中打开视频
<p><p>我试图找出当我在 iPhone 或类似设备上运行我的应用程序时视频没有被执行的原因。但是,当我在 Android 上运行它时可以执行。 Cordova 有问题吗?有没有人遇到过同样的问题?谢谢</p>
<p>TS:</p>
<pre><code>export class PlayerVideoPage {
public source: String = '';
public title: String = '';
constructor(public navCtrl: NavController, public navParams: NavParams, public orientation: OrientationService) {
this.source = navParams.get('url');
this.title = navParams.get('title');
this.orientation.unlock()
}
dismiss() {
this.navCtrl.pop();
this.orientation.lock()
}
ngOnDestroy() {
this.orientation.lock();
}
loadVideo() {
return './assets/learn/videos/' + this.source;
}
}
</code></pre>
<p>HTML:</p>
<pre><code><ion-content padding>
<h4 text-center>{{title}}</h4>
<ion-grid>
<ion-row>
<video controls playsinline>
<source ="loadVideo()"
type='video/mp4;'/>
</video>
</ion-row>
<ion-row class="button-controls">
<button ion-button icon-only round (click)="dismiss()">
<ion-icon name="close"></ion-icon>
</button>
</ion-row>
</ion-grid>
</ion-content>
</code></pre>
<p>iOS:
<a href="/image/ZyhuH.png" rel="noreferrer noopener nofollow"><img src="/image/ZyhuH.png" alt="Screenshot1"/></a> </p>
<p>安卓:
<a href="/image/wOhBP.png" rel="noreferrer noopener nofollow"><img src="/image/wOhBP.png" alt="enter image description here"/></a> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您可以在 <code>config.xml</code> 中添加以下行:</p>
<p><em>config.xml</em></p>
<pre><code><preference name="AllowInlineMediaPlayback" value="true" />
</code></pre></p>
<p style="font-size: 20px;">关于android - Ionic 3 - 无法在 iOS 手机中打开视频,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/46432882/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/46432882/
</a>
</p>
页:
[1]