If you want to show your own content or manipulate the existing output you should use the existing hook of rgmediaimages. The hook holds all the relevant information you need.
# Hook
$video = $_procObj->extraMediaProcessor($video, $config, $width, $height, $originalUrl, $this);
This is a possible way to show videos in a popup.
Create a sysfolder with a new TS-Template like this
# TS-Code
page >
page = PAGEpage {typeNum = 0
10 < styles.content.get
}
Create the pages
Create for every video a single page containing one content element “Text with media” with one video. Set a specific size and remember it. If you call this page in the frontend, you should just get the video (otherwise you did something wrong).
Link to the video
Enter the content element where you want to create the link, choose the link browser, set the size of the linked page and choose the page.
You are done!