| 1 | package XML::NewsML_G2::Role::Writer::News_Item_Video; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | with 'XML::NewsML_G2::Role::Writer'; | |||||||||
| 7 | |||||||||||
| 8 | 9 | ▶ | around '_build_g2_catalog_schemes' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 9 | my ( $orig, $self, @args ) = @_; | |||||||||
| 10 | 9 | my $result = $self->$orig(@args); | |||||||||
| 11 | 9 | $result->{rnd} = undef; | |||||||||
| 12 | 9 | return $result; | |||||||||
| 13 | 3 | }; | |||||||||
| 14 | |||||||||||
| 15 | 14 | ▶ | after '_create_remote_content' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||
| 16 | 14 | my ( $self, $root, $video ) = @_; | |||||||||
| 17 | |||||||||||
| 18 | 14 | foreach ( | |||||||||
| 19 | qw/size width height duration videoframerate videoavgbitrate audiosamplerate/ | ||||||||||
| 20 | ) { | ||||||||||
| 21 | 98 | ▶ | $root->setAttribute( $_, $video->$_ ) if defined $video->$_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 14 | my $rendition = | |||||||||
| 25 | $self->scheme_manager->build_qcode( 'vidrnd', $video->rendition ); | ||||||||||
| 26 | 14 | ▶ | $root->setAttribute( 'rendition', $rendition ) if $rendition; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 14 | my $audiochannels = | |||||||||
| 29 | $self->scheme_manager->build_qcode( 'adc', $video->audiochannels ); | ||||||||||
| 30 | 14 | ▶ | $root->setAttribute( 'audiochannels', $audiochannels ) if $audiochannels; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 3 | }; | |||||||||
| 32 | |||||||||||
| 33 | 9 | ▶ | sub _create_icon { | ||||||||
|
Subroutine
_create_icon: called CC=4 SCAR=13.9
| |||||||||||
| 34 | 9 | my ( $self, $root ) = @_; | |||||||||
| 35 | |||||||||||
| 36 | 9 | for my $icon ( @{ $self->news_item->icon } ) { | |||||||||
| 37 | 10 | my $rendition = | |||||||||
| 38 | $self->scheme_manager->build_qcode( 'rnd', $icon->rendition ); | ||||||||||
| 39 | 10 | my $icon_element = | |||||||||
| 40 | $self->create_element( 'icon', rendition => $rendition, ); | ||||||||||
| 41 | |||||||||||
| 42 | 10 | foreach (qw/href width height/) { | |||||||||
| 43 | 30 | ▶ | next unless $icon->$_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 30 | $icon_element->setAttribute( $_, $icon->$_ ); | |||||||||
| 45 | } | ||||||||||
| 46 | 10 | $root->appendChild($icon_element); | |||||||||
| 47 | } | ||||||||||
| 48 | 9 | return; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 3 | 1; | |||||||||
| 52 | __END__ | ||||||||||