NAME
Elive::Entity::Recording - Elluminate Recording Entity class
METHODS
download
my $recording = Elive::Entity::Recording->retrieve([$recording_id]);
my $binary_data = $recording->download;
Download data for a recording.
upload
# get the binary data from somewhere
open (my $fh, '<', $recording_file)
or die "unable to open $recording_file: $!";
$fh->binmode;
my $data = do {local $/ = undef; <$fh>};
die "no recording data: $recording_file"
unless ($data && length($data));
# somehow generate a unique key for the recordingId.
use Time::HiRes();
my ($seconds, $microseconds) = Time::HiRes::gettimeofday();
my $recordingId = sprintf("%d%d", $seconds, $microseconds/1000);
# associate this recording with an existing meeting (optional)
my $meetingId = '1234567890123';
my $recording = Elive::Entity:Recording->upload(
{
meetingId => $recordingId.'_'.$meetingId,
recordingId => $meetingId,
facilitator => Elive->login,
roomName => 'Meeting of the Smiths',
version => Elive->server_details->version,
data => $binary_data,
},
);
Upload data from a client and create a recording.
Note: the facilitator
, when supplied must match the facilitator for the given meetingId
.
insert
You'll typically only need to insert recordings yourself if you are importing or recovering recordings that have not been closed cleanly.
my $recordingId = "${meetingId}_import";
my $import_filename = sprintf("%s_recordingData.bin", $recording->recordingId);
#
# Somehow import the file to the server and work-out the byte-size.
# This needs to be uploaded to:
# ${instancesRoot}/${instanceName}/WEB-INF/resources/recordings
# where $instanceRoot is typically /opt/ElluminateLive/manager/tomcat
#
my $bytes = import_recording($import_filename); # implementation dependant
my $recording = Elive::Entity::Recording->insert({
recordingId => $recordingId,
roomName => "test recording import",
creationDate => time().'000',
meetingId => $meetingId,
facilitator => $meeting->faciliator,
version => Elive->server_details->version,
size => $bytes,
});
The Recording insert
method, unlike other entities, requires that you supply a primary key. This is then used to determine the name of the file to look for in the recording directory, as in the above example.
The meetingId
is optional. Recordings do not have to be associated with a particular meetings. They will still be searchable and are available for playback.
web_url
Utility method to return various website links for the recording. This is available as both class level and object level methods.
#
# Class level access.
#
my $url = Elive::Entity::Recording->web_url(
recording_id => $recording_id,
action => 'play',
connection => $my_connection); # optional
#
# Object level.
#
my $recording = Elive::Entity::Recording->retrieve([$recording_id]);
my $url = recording->web_url(action => 'join');
buildJNLP
my $jnlp = $recording_entity->buildJNLP(version => version,
userId => $user->userId,
userIP => $ENV{REMOTE_ADDR});
Builds a JNLP for the recording.
JNLP is the 'Java Network Launch Protocol', also commonly known as Java WebStart. You can, for example, render this as a web page with mime type application/x-java-jnlp-file
.
The userIP
is required for elm 9.0+ when recordingJNLPIPCheck
has been set to true
in configuration.xml
(or set interactively via: Preferences >> Session Access >> Lock Recording Playback to Client IP)
It represents a fixed client IP address for launching the recording playback.
See also http://wikipedia.org/wiki/JNLP.