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

Show Embed video in client #234

Open
huysynf opened this issue Jul 22, 2024 · 0 comments · May be fixed by #235
Open

Show Embed video in client #234

huysynf opened this issue Jul 22, 2024 · 0 comments · May be fixed by #235

Comments

@huysynf
Copy link

huysynf commented Jul 22, 2024

When I embed video use button Add media cloud video and save.
In client it show error

Notice: Trying to get property 'width' of non-object in /var/www/wp-content/plugins/ilab-media-tools/classes/Tools/Video/Player/VideoPlayerShortcode.php on line 99

So I try to fixed and find code not working in file VideoPlayerShortcode.php line 99
Code in plugin

if ( empty($asset) ) {
            $width = intval( arrayPath( $meta, 'width', (int) 0 ) );
            $height = intval( arrayPath( $meta, 'height', (int) 0 ) );
            if ( !empty($width) && !empty($height) ) {
                // error in here
                $extras .= " width={$asset->width} height={$asset->height}";
            }
        } else {
            $extras .= " width={$asset->width} height={$asset->height}";
        }

====> may be change to fixed it

if ( empty($asset) ) {
            $width = intval( arrayPath( $meta, 'width', (int) 0 ) );
            $height = intval( arrayPath( $meta, 'height', (int) 0 ) );
            if ( !empty($width) && !empty($height) ) {
                $extras .= " width={$width} height={$height}";
            }
        } else {
            $extras .= " width={$asset->width} height={$asset->height}";
        }
@huysynf huysynf linked a pull request Jul 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant