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...