Skip to content

Problem with AutoplaySlider and avif files #196

@realkhanhson

Description

@realkhanhson

I found some problem with avif files, It didn't work with AutoplaySlider

Screenshot from 2021-09-15 11-59-08

so as you can see, it only loads more than 70% then stop

I'm currently using nextjs 11.1.2, and this is my code.

import { FC } from 'react'
import style from './ImageSlider.module.css'
import AwesomeSlider from 'react-awesome-slider'
import withAutoplay from 'react-awesome-slider/dist/autoplay'

interface Props {
  className?: string
}

const AutoplaySlider = withAutoplay(AwesomeSlider)

const images = ['/banner/01.avif', '/banner/02.avif']

const ImageSlider: FC<Props> = ({ className }) => {
  return (
    <div className={className}>
      <AutoplaySlider
        // animation="foldOutAnimation"
        play={true}
        cancelOnInteraction={false}
        interval={5000}
        cssModule={style}
      >
        {images.map((image) => (
          <div key={image} data-src={image} />
        ))}
      </AutoplaySlider>
    </div>
  )
}
export default ImageSlider

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions