1.0.37 • Published 2 years ago

@filmgardi/aparat v1.0.37

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years 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

2 years ago

1.0.36

2 years ago

1.0.35

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.34

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.9

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago