Ionic3 learning: Using videogular2 for video playback and some problems encountered, ionic3videogular2

Source: Internet
Author: User

Ionic3 learning: Using videogular2 for video playback and some problems encountered, ionic3videogular2
DirectoryUse videogular2
How to install and add icons and fonts to support importing modules
IOS automatically enters full-screen playback. Android autoplay does not work. More1. Use videogular2Install

Terminal operation:

npm install videogular2 --savenpm install @types/core-js --save-dev
Added support for icons and Fonts

Videogular2 GitHub

Run git to clone it.Copy the fonts folder to your Ionic ProjectIn the assets folderIntroduce the videogular css file in index.html:

Import module

Import the page module of videogular2, for exampleFor use in trailer.html, I will import itTrailer. module. ts.

import {NgModule} from '@angular/core';import {IonicPageModule} from 'ionic-angular';import {VgCoreModule} from 'videogular2/core';import {VgControlsModule} from 'videogular2/controls';import {VgOverlayPlayModule} from 'videogular2/overlay-play';import {VgBufferingModule} from 'videogular2/buffering';import {TrailerPage} from './trailer';@NgModule({  declarations: [    TrailerPage,  ],  imports: [    VgCoreModule,    VgControlsModule,    VgOverlayPlayModule,    VgBufferingModule,    IonicPageModule.forChild(TrailerPage),  ],})export class TrailerPageModule {}
For example
  
       
        
        
        
         
         
         
          
          
         
         
         
       
        
        
      
2. Problems Encountered IOS automatically enters full screen playback

ToAdd video tagsPlaysinline (iOS 10 and later ),Webkit-playsinline (before iOS 10) attributes.

In additionAdd the config. xml file


       
Android-side autoplay does not work

Who is this... Long talk... No...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.