0.0.8 • Published 7 years ago

modal-slider-photos-and-videos v0.0.8

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

modal-slider-photos-and-videos

Use for ionic 2

Installation

npm i --save modal-slider-photos-and-videos

Config in the app.module.ts

import * as ionicGalleryModal from 'ionic-gallery-modal';
import { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';

imports: [
  //...
  ionicGalleryModal.GalleryModalModule,
  //...
],

providers: [
  //...
  {
    provide: HAMMER_GESTURE_CONFIG,
    useClass: ionicGalleryModal.GalleryModalHammerConfig,
  },
  //...
],

Usage in the component

import { ModalController } from 'ionic-angular';
import { GalleryModal } from 'modal-slider-photos-and-videos';

constructor(
    //...
    public modalCtrl: ModalController,
    //...
){}

Slider photos:

let modal = this.modalCtrl.create(GalleryModal, {
  typeModal: "photo",
  photos: array_photo,
  initialSlide: currentIndex
});
modal.present();

Slider videos:

let modal = this.modalCtrl.create(GalleryModal, {
  typeModal: "video",
  videos: array_video,
  initialSlide: currentIndex
});
modal.present();

Option

NameTypeValueDescription
typeModalstring"photo"when use slider for photos
typeModalstring"video"when use slider for videos
photosarray[]is array information of all photos
videosarray[]is array information of all videos
initialSlidenumber0pass params is index of a photo or a video need show

Option of array photos

NameTypeValueDescription
urlstringlink of photo
avatarstringlink image avatar of user post this photo
namestringname of user post this photo
titlestringtitle of this photo
datestringdate published this photo

Example

{
  url: "http://example.com/images/photo_1.jpg",
  avatar: "http://example.com/avatar/david.jpg",
  name: "David Beckham",
  title: "Goal Goal!",
  date: "3 months ago"
}

Option of array videos

NameTypeValueDescription
urlstringlink local of video
posterstringlink of image show before play video
avatarstringlink image avatar of user post this video
namestringname of user post this video
titlestringtitle of this video
datestringdate published this video

Example

{
  url: "http://abc.com/media/video.mp4",
  poster: "http://example.com/poster/juventus.jpg",
  avatar: "http://example.com/avatar/buffon.jpg",
  name: "Buffon",
  title: "Save save!",
  date: "3 months ago"
}
0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.0

7 years ago