Autoplay Player Example

Big Buck Bunny

Big Buck Bunny (code-named Project Peach) is a 2008 short computer-animated comedy film featuring animals of the forest, made by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film, Elephants Dream, the film was made using Blender, a free and open-source software application for 3D computer modeling and animation developed by the same foundation. Unlike that earlier project, the tone and visuals departed from a cryptic story and dark visuals to one of comedy, cartoons, and light-heartedness.

Code

        
            @Component({
                selector: 'app-player',
                standalone: true,
                imports: [ByteArkPlayerContainer],
                template: `
                    <byteark-player-container [options]="options"/>
                `
            })
            export class PlayerComponent {
                options: ByteArkPlayerContainerProps = {
                    fluid: true,
                    autoplay: 'any',
                    lazyload: true,
                    aspectRatio: '16:9',
                    poster: videos[0].poster,
                    sources: [
                        {
                            src: videos[0].src,
                            type: videos[0].type,
                            title: videos[0].title
                        }
                    ],
                    onPlayerCreated: () => {
                        console.log('Created!');
                    },
                    onReady: () => {
                        console.log('Ready!');
                    }
                }
            }