Notice: Undefined variable: streamId in C:\xampp\htdocs\vonagephp\index.php on line 46
This is the problem. I hope someone can help me. I am creating a opentok video using the php sdk but I have come across this issue. I will be very happy if someone who has this issue can help me out. Thanks guys
require 'vendor/autoload.php';
use OpenTok\OpenTok;
$apiKey = "key";
$apiSecret = "secret";
$opentok = new OpenTok($apiKey, $apiSecret);
use OpenTok\MediaMode;
use OpenTok\ArchiveMode;
// Create a session that attempts to use peer-to-peer streaming:
$session = $opentok->createSession();
// A session that uses the OpenTok Media Router, which is required for archiving:
$session = $opentok->createSession(array( 'mediaMode' => MediaMode::ROUTED ));
// A session with a location hint:
$session = $opentok->createSession(array( 'location' => '12.34.56.78' ));
// An automatically archived session:
$sessionOptions = array(
'archiveMode' => ArchiveMode::ALWAYS,
'mediaMode' => MediaMode::ROUTED
);
$session = $opentok->createSession($sessionOptions);
// Store this sessionId in the database for later use
$sessionId = $session->getSessionId();
use OpenTok\Session;
// Get stream info from just a sessionId (fetched from a database)
$stream = $opentok->getStream($sessionId, $streamId);
// Stream properties
$stream->id; // string with the stream ID
$stream->videoType; // string with the video type
$stream->name; // string with the name
$stream->layoutClassList; // array with the layout class list
// Get list of streams from just a sessionId (fetched from a database)
$streamList = $opentok->listStreams($sessionId);
$streamList->totalCount(); // total count
// Create a simple archive of a session
$archive = $opentok->startArchive($sessionId);
// Create an archive using custom options
$archiveOptions = array(
'name' => 'Important Presentation', // default: null
'hasAudio' => true, // default: true
'hasVideo' => true, // default: true
'outputMode' => OutputMode::COMPOSED, // default: OutputMode::COMPOSED
'resolution' => '1280x720' // default: '640x480'
);
$archive = $opentok->startArchive($sessionId, $archiveOptions);
// Store this archiveId in the database for later use
$archiveId = $archive->id;
// Stop an Archive from an archiveId (fetched from database)
$opentok->stopArchive($archiveId);
// Stop an Archive from an Archive instance (returned from startArchive)
$archive->stop();
$archive = $opentok->getArchive($archiveId);
// Delete an Archive from an archiveId (fetched from database)
$opentok->deleteArchive($archiveId);
// Delete an Archive from an Archive instance (returned from startArchive, getArchive)
$archive->delete();
$archiveList = $opentok->listArchives();
I am creating a opentok video using the php sdk but I have come across this issue. I will be very happy if someone who has this issue can help me out. Thanks guys