1.0.37 • Published 4 months ago

@filmgardi/aparat v1.0.37

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

aparat-player

Usage

To include aparat-player on your website or web application, use the following method.

<script src="//path/to/aparat.min.js"></script>

The aparat function also accepts an options object and a callback to be invoked when the player is ready:

var options = {
	autoplay: false,
	controls: true,
	playbackRates: [0.5, 1, 1.25, 1.5, 3],
	language: 'fa',
	addLanguage: { fa: fa },
	poster: '',
	sources: [],

	info: { title: null, subTitle: null },
	returnUrl: null,
	pluginOptions: {
		seekThumbnailSrc: null,
		seekButtons: {
			forward: 30,
			back: 10,
			forwardIndex: 1,
			backIndex: 1
		},
		nextEpisode: {
			url: '',

			autoAdvance: true,
			showAutoAdvanceButton: true,
			autoAdvanceButtonText: 'قسمت بعدی',
			nextEpisodeDisplayTime: null,
			nextEpisodeDisplayDuration: 10,

			dialogData: {
				title: '',
				description: '',
				url: ``
			},
			dialogTemplate: ({ title, description, url }) => {
				return 'some htmlDom';
			}
			placementIndex: 9,
		},
		skipButton: {
			text: 'skipOpeningCredits',
			from: null,
			to: null,
			position: 'bottom-right',
			offsetH: 46,
			offsetV: 167
		},
		trafficUsage: {
			title: null,
			message: null,
			expireTime: 5, // minute
			position: 'top-right',
			offsetH: 46,
			offsetV: 46
		},
		subtitleSettings: {},
		seasonPlaylist: {
			seasons: null, // array of number
			getEpisode: (season, page, callback) => {
				callback({
					alias: '',
					duration: 0,
					link: '',
					part: 0,
					season: 0,
					thumbnail: '',
					title: null
				});
			}
		},
		vote: {
			submitVote: ({ likeStatus, callback }) => {}, //Tips: likeStatus returns 1 if liked and 2 if disliked
			from: null,
			to: null,
			position: 'bottom-right',
			offsetH: 46,
			offsetV: 167
		},
		collectData: {
			token: ''
		},
		markers: {
			markerTip: {
				display: false,
				skip: true
			},
			onMarkerReached: (marker, index) => {
				console.log(marker, index);
			},
			onMarkerSkipZone: (marker, index) => {
				console.log('onMarkerSkipZone');
			},
			markers: [{ time: null, duration: null }]
		}
	}
	initPlugins: {
	  ...pluginNames
	},
	controlBar: { children: ['componentName'] },
};

var aparat = aparat('my-player', options, function onPlayerReady() {
  videojs.log('Your player is ready!');

  // In this context, `this` is the player that was created by Video.js.
  this.play();

  // How about an event listener?
  this.on('ended', function() {
    videojs.log('Awww...over so soon?!');
  });
});
1.0.37

4 months ago

1.0.36

4 months ago

1.0.35

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.34

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.8

2 years ago

1.0.9

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago