<small id='NFWPJ'></small><noframes id='NFWPJ'>

<i id='NFWPJ'><tr id='NFWPJ'><dt id='NFWPJ'><q id='NFWPJ'><span id='NFWPJ'><b id='NFWPJ'><form id='NFWPJ'><ins id='NFWPJ'></ins><ul id='NFWPJ'></ul><sub id='NFWPJ'></sub></form><legend id='NFWPJ'></legend><bdo id='NFWPJ'><pre id='NFWPJ'><center id='NFWPJ'></center></pre></bdo></b><th id='NFWPJ'></th></span></q></dt></tr></i><div id='NFWPJ'><tfoot id='NFWPJ'></tfoot><dl id='NFWPJ'><fieldset id='NFWPJ'></fieldset></dl></div>
    1. <legend id='NFWPJ'><style id='NFWPJ'><dir id='NFWPJ'><q id='NFWPJ'></q></dir></style></legend>
        <bdo id='NFWPJ'></bdo><ul id='NFWPJ'></ul>

    2. <tfoot id='NFWPJ'></tfoot>

        HTML5 视频播放()不播放 ionic 3“ios 和 android"

        HTML5 video play() not playing ionic 3 quot;ios and android(HTML5 视频播放()不播放 ionic 3“ios 和 android)
      1. <legend id='d61eB'><style id='d61eB'><dir id='d61eB'><q id='d61eB'></q></dir></style></legend>

          • <bdo id='d61eB'></bdo><ul id='d61eB'></ul>

                <tbody id='d61eB'></tbody>
                <i id='d61eB'><tr id='d61eB'><dt id='d61eB'><q id='d61eB'><span id='d61eB'><b id='d61eB'><form id='d61eB'><ins id='d61eB'></ins><ul id='d61eB'></ul><sub id='d61eB'></sub></form><legend id='d61eB'></legend><bdo id='d61eB'><pre id='d61eB'><center id='d61eB'></center></pre></bdo></b><th id='d61eB'></th></span></q></dt></tr></i><div id='d61eB'><tfoot id='d61eB'></tfoot><dl id='d61eB'><fieldset id='d61eB'></fieldset></dl></div>

                <small id='d61eB'></small><noframes id='d61eB'>

                <tfoot id='d61eB'></tfoot>

                  本文介绍了HTML5 视频播放()不播放 ionic 3“ios 和 android"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经搜索了很长时间并尝试了很多方法,但似乎没有任何效果.我有一个视频标签,当我点击它时我想播放它.我正在研究 Ionic 3 和 Angular.代码如下所示.如果我错过了什么,请帮助我或指导我.

                  I have been searching for a long time and have tried a lot of approaches but nothing seems to be working. I have a video tag which I want to be played when I tap over it. I am working on Ionic 3 and angular. The code is shown below. Please help me out or direct me if I missed anything.

                  HTML:

                      <video id="edit-video-element"
                       width="100%"
                       [src]="videoPath"
                       webkit-playsinline
                       poster="{{thumbnailPath}}" controls autobuffer >
                      </video>
                  

                  .ts 文件

                      this.video = document.getElementsByTagName('video')[0];
                  
                      onVideoClick(e) {
                       (this.video.paused) ? this.video.play() : this.video.pause();
                      }
                  

                  它没有显示任何问题,但根本不起作用.

                  Its not displaying any issues, but not working at all.

                  更新:

                      <video *ngIf="hasVideo" width="100%" controls autoplay>
                       <source [src]="videoPath" type="video/mp4">
                      </video>
                  

                  我添加了这个,然后在 .ts 文件中我的 videoPath 为:

                  I added this and then in the .ts file I have the videoPath as:

                  file:///private/var/mobile/Containers/Data/Application/99091302-995E-40C7-AF66-0E07BCF09220/tmp/trim.E4AE7B29-06BB-4077-A56A-B546A53267DC.MOV

                  file:///private/var/mobile/Containers/Data/Application/99091302-995E-40C7-AF66-0E07BCF09220/tmp/trim.E4AE7B29-06BB-4077-A56A-B546A53267DC.MOV

                  更新:我能够使它适用于相册中的文件我必须安装DomSanitizer",然后在我的视频标签中添加 _DomSanitizationService.bypassSecurityTrustUrl(yourFilePath).

                  Update: I was able to make it work for the files from photo album I had to install "DomSanitizer" and then add _DomSanitizationService.bypassSecurityTrustUrl(yourFilePath) in my video tag.

                  推荐答案

                  试试这个.对我来说效果很好.

                  Try this out. It's working fine for me.

                  HTML

                   <video #videoPlayer class="video-player" controls></video>
                  

                  TS

                   @ViewChild('videoPlayer') mVideoPlayer: any;
                  
                    ionViewDidLoad() {
                      let video = this.mVideoPlayer.nativeElement;
                      video.src = 'http://techslides.com/demos/sample-videos/small.mp4';
                      video.play();
                    }
                  

                  sass

                   .video-player {
                      width: 100%;
                      height: 100%;
                    }
                  

                  这篇关于HTML5 视频播放()不播放 ionic 3“ios 和 android"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Plot data in website from multiple csv file(从多个 csv 文件中绘制网站中的数据)
                  Content Service for Google Apps Script returning HTML instead of JSON(返回 HTML 而不是 JSON 的 Google Apps 脚本的内容服务)
                  Javascript Confirm popup Yes, No button instead of OK and Cancel(Javascript 确认弹出窗口是,否按钮而不是确定和取消)
                  Opensource/free HTML5/CSS3/JavaScript IDE?(开源/免费 HTML5/CSS3/JavaScript IDE?)
                  jump to CSS selector in a css file from the HTML file in Vim using a single keystroke(使用单次击键从 Vim 中的 HTML 文件跳转到 CSS 文件中的 CSS 选择器)
                  Is there a good in-browser code editor?(有没有好的浏览器内代码编辑器?)

                  1. <legend id='IrhPz'><style id='IrhPz'><dir id='IrhPz'><q id='IrhPz'></q></dir></style></legend>
                    <i id='IrhPz'><tr id='IrhPz'><dt id='IrhPz'><q id='IrhPz'><span id='IrhPz'><b id='IrhPz'><form id='IrhPz'><ins id='IrhPz'></ins><ul id='IrhPz'></ul><sub id='IrhPz'></sub></form><legend id='IrhPz'></legend><bdo id='IrhPz'><pre id='IrhPz'><center id='IrhPz'></center></pre></bdo></b><th id='IrhPz'></th></span></q></dt></tr></i><div id='IrhPz'><tfoot id='IrhPz'></tfoot><dl id='IrhPz'><fieldset id='IrhPz'></fieldset></dl></div>
                      • <bdo id='IrhPz'></bdo><ul id='IrhPz'></ul>
                      • <small id='IrhPz'></small><noframes id='IrhPz'>

                      • <tfoot id='IrhPz'></tfoot>

                          <tbody id='IrhPz'></tbody>