David Warring > Elive-1.30 > Elive::Entity::Recording

Download:
Elive-1.30.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source   Latest Release: Elive-1.32

NAME ^

Elive::Entity::Recording - Elluminate Recording Entity class

METHODS ^

web_url

Utility method to return various website links for the recording. This is available as both object and class level methods.

    #
    # Object level.
    #
    my $recording = Elive::Entity::Recording->retrieve($recording_id);
    my $url = recording->web_url(action => 'play');

    #
    # Class level access.
    #
    my $url = $recording->web_url(
                     action => 'play',
                     recording_id => $recording_id,
                     connection => $my_connection);  # optional

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.

download

    my $recording = Elive::Entity::Recording->retrieve($recording_id);
    my $binary_data = $recording->download;

Download data for a recording.

upload

This method lets you import recordings to an Elluminate Server.

You'll need supply binary data, a generated recording-Id and, optionally, an associated meeting:

    use Elive;
    use Elive::Entity::Recording;

    sub example_upload {
        #
        # demo subroutine to upload a recording file to an Elluminate server
        # - assumes that we are already connected to the server
        #
        my $recording_file = shift;   # path to recording file
        my %opt = @_;

        # get the binary data from somewhere

        open (my $fh, '<', $recording_file)
            or die "unable to open $recording_file: $!";
        $fh->binmode;

        my $binary_data = do {local $/ = undef; <$fh>};
        die "no recording data: $recording_file"
            unless ($binary_data && length($binary_data));

        # somehow generate a unique key for the recordingId.

        use Time::HiRes();
        my ($seconds, $microseconds) = Time::HiRes::gettimeofday();
        my $recordingId = sprintf("%d%04d_upload", $seconds, $microseconds/1000);

        my %recording_data = (
            data => $binary_data,
            recordingId => $recordingId,
            version => $opt{version},
            );

        if (my $meeting = $opt{meeting}) {
            #
            # associate the recording with this meeting
            #
            $recording_data{meetingId} = $meeting->meetingId;
            $recording_data{roomName}  = $meeting->name;
            $recording_data{facilitator} = $meeting->facilitatorId;
        }

        $recording_data{version} ||= Elive->server_details->version;
        $recording_data{facilitator} ||= Elive->login;

        my $recording = Elive::Entity::Recording->upload( \%recording_data );

        return $recording;
    }

Note: the facilitator, when supplied must match the facilitator for the given meetingId.

insert

The insert() method is typically used to describe files that are present in the site's recording directory.

You'll may need to insert recordings yourself if you are importing large volumes of recording files or to recover recordings that have not been closed cleanly.

    sub demo_recording_insert {
        my $import_filename = shift;
        my $meeting = shift;

        my $recordingId = $meeting->meetingId.'_import';
        my $import_filename = sprintf("%s_recordingData.bin", $recordingId);

        #
        # Somehow upload 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,
            creationDate => time().'000',
            meetingId => $meeting->meetingId,
            facilitator => $meeting->facilitator,
            roomName => $meeting->name,
            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.

syntax highlighting: