Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long loading times when using a video on a Page #145

Open
mate-code opened this issue Nov 12, 2021 · 3 comments
Open

Very long loading times when using a video on a Page #145

mate-code opened this issue Nov 12, 2021 · 3 comments
Labels
improvement Refinement of existing feature

Comments

@mate-code
Copy link
Contributor

I use a video on one of my pages (1080p, 2:42, 156 MB) and every time I klick on the "Next" button, I get up to 10 seconds waiting times. I was wondering if anybody else can reproduce this issue or is it doe to running the experiment locally?

@jobrachem
Copy link
Collaborator

Hi Marius, thanks for pointing out the issue! Would you provide us with a minimal example and, ideally, the video file for reproduction?

@mate-code
Copy link
Contributor Author

mate-code commented Nov 16, 2021

Minimum example:

import alfred3 as al

exp = al.Experiment()


@exp.member(of_section="main")
class VideoPage(al.WidePage):

    def on_first_show(self):
        gender = self.exp.values.get("gender")
        self.exp.randomizer = al.ListRandomizer(
            ("video_male", 60), ("video_female", 60), name=gender, exp=self.exp
        )
        self.exp.condition = self.exp.randomizer.get_condition()

    def on_exp_access(self):
        condition = self.exp.condition
        video = "male" if condition == "video_male" else "female"
        p = self
        p += al.Video(
            path=f"media/condition-{video}-1080p.mp4",
            allow_fullscreen=True,
            autoplay=True,
            controls=False,
            loop=False,
        )

I'll send you the video privately, as some of the actors do not want the video publicly posted

@jobrachem
Copy link
Collaborator

It is probably best to upload videos to Youtube or a similar service and then embed them with an html element. We give this issue low priority for the time being.

@jobrachem jobrachem added the improvement Refinement of existing feature label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Refinement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants