0

I made a test video to check how exact the PP links are. If someone clicks on the text, then the video should play from start-bookmark to end-bookmark. It stops not always on the end-bookmark! why? performance problem on powerpoint?

I want to put image, but i cannot, because I need at least 10 reputation.

UPDATE: I am using Action settings.

The code with trigger

Private Sub setStartAndEndPointOnVideoTrigger(activeSlide As Slide, clickShape As Shape, movieShape As Shape, _
                          startBookmark As MediaBookmark, endBookmark As MediaBookmark)

   Dim oEffectStart As Effect
   Dim oEffectEnd As Effect
   Dim obhvEffect As AnimationBehavior
   Dim delayTime As Double

   delayTime = (endBookmark.Position - startBookmark.Position) / 1000

   With activeSlide
   Set oEffectStart = .TimeLine.InteractiveSequences.Add _
                        .AddTriggerEffect(movieShape, msoAnimEffectMediaPlayFromBookmark, _
                        msoAnimTriggerOnShapeClick, clickShape, startBookmark.Name)

   Set oEffectEnd = .TimeLine.InteractiveSequences.Add _
                        .AddTriggerEffect(movieShape, msoAnimEffectMediaPause, _
                        msoAnimTriggerOnShapeClick, clickShape)

   Set obhvEffect = oEffectStart.Behaviors.Add(msoAnimTypeCommand)
   obhvEffect.CommandEffect.Bookmark = startBookmark.Name

   oEffectEnd.Timing.TriggerType = msoAnimTriggerWithPrevious
   oEffectEnd.Timing.TriggerDelayTime = delayTime
   End With

   End Sub
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Argonist
  • 7
  • 1
  • 7

1 Answers1

0

There may be additional issues as I am not so familiar with some of the new methods in the 2010 version, however, it appears there may be some issues regarding your use of With statements. Try this:

Private Sub setStartAndEndPointOnVideoTrigger(activeSlide As Slide, clickShape As Shape, movieShape As Shape, _
                          startBookmark As MediaBookmark, endBookmark As MediaBookmark)

    Dim oEffectStart As Effect
    Dim oEffectEnd As Effect
    Dim obhvEffect As AnimationBehavior
    Dim delayTime As Double

    delayTime = (endBookmark.Position - startBookmark.Position) / 1000

    With activeSlide.TimeLine.InteractiveSequences

        With .Add(1)
            Set oEffectStart = .AddTriggerEffect(movieShape, msoAnimEffectMediaPlayFromBookmark, _
                                msoAnimTriggerOnShapeClick, clickShape, startBookmark.Name)
        End With

        With .Add(2)
            Set oEffectEnd = .AddTriggerEffect(movieShape, msoAnimEffectMediaPause, _
                            msoAnimTriggerOnShapeClick, clickShape)
        End With

    End With

    Set obhvEffect = oEffectStart.Behaviors.Add(msoAnimTypeCommand)
    obhvEffect.CommandEffect.Bookmark = startBookmark.Name

    oEffectEnd.Timing.TriggerType = msoAnimTriggerWithPrevious
    oEffectEnd.Timing.TriggerDelayTime = delayTime

End Sub
Taliesin
  • 389
  • 1
  • 12
  • I tried with you code. But it works the same. The stopping of video works well, but not always on bookmark! Always stopping some sec before bookmark. – Argonist Mar 27 '13 at 10:40