PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.31k stars 521 forks source link

Allow Loop Continuously to be set to true #154

Closed pickupman closed 8 years ago

pickupman commented 8 years ago

PowerPoint 2007 file format can be played continuously with the following code added to Writer/PowerPoint2007/PptsProps.php at Line 44 adding:

// Enable slideshow to autoloop
$objWriter->startElement('p:showPr');
$objWriter->writeAttribute('loop', '1');
$objWriter->endElement();

This adds a p:showPr child element to p:presentationPr that allows the slideshow to keep playing until [Esc] is pressed.

Progi1984 commented 8 years ago

Note for Libreoffice Impress users : https://ask.libreoffice.org/en/question/92/loop-an-impress-presentation/

OpenXML :

OpenDocument :

<!-- content.xml -->
            <presentation:settings presentation:endless="true" presentation:pause="P0D" presentation:mouse-visible="false"/>
        </office:presentation>
    </office:body>
</office:document-content>

@pickupman Could you give a screenshot of Powerpoint for defining the slideshow endless ? Can you define a pause between each presentation ?

pickupman commented 8 years ago

@Progi1984 here is a screenshot from PowerPoint 2007. You only have the option to loop continously. No option to set a delay/pause between presentations.

clipboard01

pickupman commented 8 years ago

Here is the element for the ODPresentation Writer class in Content.php at line 302:

// Enable slideshow to autoloop
$objWriter->startElement('presentation:settings');
$objWriter->writeAttribute('presentation:endless', "true");
$objWriter->writeAttribute('presentation:pause', "P0s");
$objWriter->writeAttribute('presentation:mouse-visible', "false");
 $objWriter->endElement();
Progi1984 commented 8 years ago

@pickupman : Could you test the PR #157, please ? Thanks :)

Progi1984 commented 8 years ago

@pickupman : Just fixed your request. Could you give me feedback, please :)

Progi1984 commented 8 years ago

@pickupman Have you got time for testing the Pull Request before integration in develop branch ? Thanks for your feedback.

Progi1984 commented 8 years ago

@pickupman Have you got time for testing the Pull Request before integration in develop branch ? Thanks for your feedback.

Progi1984 commented 8 years ago

Merged in develop branch.

toleabivol commented 4 years ago

@Progi1984 how to set a delay in seconds for each slide (pause during loop) ? I found to be able only to set the isLoopContinuouslyUntilEsc to true