View Video2 Firebase

‘;
echo do_shortcode(‘
video
play-sharp-fill
‘);
echo ‘
1. After clicking download button, right click on the video

2. Select \’Save Video As…\’ to download video onto your device

[easy_media_download2 url=”‘ . $videoUrl . ‘” text=”Download Video” bg_color=”#ff6303″ hover_bg_color=”#ff9a03″ font_size=”16px” force_dl=”1″]

‘;
} else if (strlen($videoObjectId) === 10) {
// Parse object ID is passed in. Retrieve everyting from Parse.
// Set up and execute curl
$url = ‘https://parseapi.back4app.com/classes/Video2/’ . $videoObjectId;
$headers = array(
“X-Parse-Application-Id: 9s7Zfx1VQafAc1raQ9iHvWpNIfYk7nGV8YX8h5jq”,
“X-Parse-REST-API-Key: TiWvQ83bIfqAKIjl292jPN3zx3RIjDb15X5pYtKZ”
);
$rest = curl_init();
curl_setopt($rest, CURLOPT_URL, $url);
curl_setopt($rest, CURLOPT_HTTPGET, 1);
curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($rest);
curl_close($rest);
$response = json_decode($response, 1);

if (isset($response[‘objectId’])) {
// Object found
$videoUrl = ‘https://s3.amazonaws.com/swingprofilevideo/’ . $response[‘videoLink’];
$thumbnailUrl = $response[‘thumbnail’][‘url’];
$sequenceUrl = $response[‘seq24M’][‘url’];

// Get comments
// Build up query
$query = ‘where=’ . rawurlencode(‘{“video”:{“__type”:”Pointer”,”className”:”Video”,”objectId”:”‘ . $videoObjectId . ‘”},”type”:”comment”}’);
// Order by ascending createdAt
$query .= ‘&order=createdAt’;
// Include the fromUser
$query .= ‘&include=fromUser’;
$url = ‘https://api.parse.com/1/classes/Activity?’ . $query;

$rest = curl_init();
curl_setopt($rest, CURLOPT_URL, $url);
curl_setopt($rest, CURLOPT_HTTPGET, 1);
curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
$actResponse = curl_exec($rest);
curl_close($rest);
$actResponse = json_decode($actResponse, 1);

// Decode video info from photo object
$jsonUrl = $response[‘videoInfo’][‘url’];
$videoInfo = json_decode(file_get_contents($jsonUrl), 1);
echo ‘

‘;
echo do_shortcode(‘
video
play-sharp-fill
‘);
echo ‘
Player: ‘ . $videoInfo[‘playerInfo’][‘firstName’] . ‘ ‘ . $videoInfo[‘playerInfo’][‘lastName’] . ‘

Note: ‘ . $videoInfo[‘videoInfo’][‘note’] . ‘

1. After clicking download button, right click on the video

2. Select \’Save Video As…\’ to download video onto your device

[easy_media_download2 url=”‘ . $videoUrl . ‘” text=”Download Video” bg_color=”#ff6303″ hover_bg_color=”#ff9a03″ font_size=”16px” force_dl=”1″]

‘;
if ($currentUser[2] >= 0) {
if (isset($actResponse[‘results’])) {
// Comments retrieved
$results = $actResponse[‘results’];
// Loop through results. If no toUser toEmail, it is a regular comment.
// Otherwise it is a share.
for ($i = 0; $i < count($results); $i++) { $parseDate = $results[$i]['createdAt']; $timezone = new DateTimeZone("UTC"); $date = DateTime::createFromFormat('Y-m-d\TG:i:s.u\Z', $parseDate, $timezone); $dateStr = $date->format(‘M d, Y’);
if ($results[$i][‘toUser’] == null && strlen($results[$i][‘toEmail’]) == 0) {
// Is a comment
// Get date

echo ‘

‘;
echo $results[$i][‘fromUser’][‘firstName’] . ‘ ‘ . $results[$i][‘fromUser’][‘lastName’] .
‘@’ . $dateStr . ‘:
‘ . $results[$i][‘content’];
echo ‘

‘;
} else {
// Is a share
if ($i == 0) {
// Is first result
if (strlen($results[0][‘content’]) > 0) {
// Has a comment
echo ‘

‘;
echo $results[0][‘fromUser’][‘firstName’] . ‘ ‘ . $results[0][‘fromUser’][‘lastName’] .
‘@’ . $dateStr . ‘:
‘ . $results[0][‘content’];
echo ‘

‘;
}
}
}
}
} else {
// Curl to retrieve comments failed
}
} else {
// Don’t have subscription
echo ‘

You must be logged in with an ELITE or above subscription to view comments here. Check out our subscription plans!

‘;
}
echo ‘

‘;
} else {
// Object not found
echo ‘Video not found.’;
}
}
} else {
// Url doesn’t contain v parameter
echo ‘Invalid link.’;
}

?>

Download Now For FREE

SwingProfile golf swing analyzer and training aid is a must-have for golfers of all level.

Download on the App Store