Video Embed issue in cake php 3.0

I am new to cake php, i installed cakephp-video-helper-master helper plugin for embedding videos and in my bootstrap file i autoloaded that plugin like this Plugin::load('VideoEmbed', ['autoload' => true]); My view file includes the line:

echo $this->Video->embed($video['Video']['https://www.youtube.com/embed/ms7M8q1UTVk']);` 

It shows video is undefined as error. Error screen: error screenView view file

4,459 1 1 gold badge 16 16 silver badges 37 37 bronze badges asked Jan 18, 2016 at 8:41 193 3 3 silver badges 17 17 bronze badges By the way: There is also github.com/dereuromark/MediaEmbed Commented Jan 18, 2016 at 19:21

2 Answers 2

The first parameter of VideoEmbed is the video's URL (a string ). So your call needs to look something like:-

echo $this->Video->embed('https://www.youtube.com/embed/ms7M8q1UTVk'); 

According to your error messages $video hasn't even been defined so you are not actually passing anything to the helper method. Make sure your $video variable is set in your controller and that the array value you are passing the embed method is a string URL. You're probably looking to do something like:-

if (!empty($video['Video']['url'])) < echo $this->Video->embed($video['Video']['url']); >