1. Because of the need of the project, we need a video playback function. After Baidu, many people recommend using videogular2, but report errors when using it
. paste my code:
training-start.Module.ts code:
import {NgModule} from"@ angular/core";
import {IonicPageModule} from "ionic-angular";
import {TrainingStartPage} from". / training-start";
import {VgCoreModule} from "videogular2/core";
import {VgControlsModule} from" videogular2/controls";
import {VgOverlayPlayModule} from "videogular2/overlay-play";
import {VgBufferingModule} from" videogular2/buffering";
@ NgModule ({
declarations: [
TrainingStartPage,
],
imports: [
VgCoreModule,
VgControlsModule,
VgOverlayPlayModule,
VgBufferingModule,
IonicPageModule.forChild(TrainingStartPage),
],
})
export class TrainingStartPageModule {
}
Code in html:
< ion-header >
< ion-navbar >
<ion-title></ion-title>
< / ion-navbar >
< / ion-header >
< ion-content padding >
< vg-player >
<video [vgMedia]="media" -sharpmedia id="singleVideo" preload="auto" controls>
<source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
</video>
< / vg-player >
< / ion-content >
error report: