<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nielsentest.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AiOS_Sequence_of_Calls</id>
	<title>Template:iOS Sequence of Calls - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nielsentest.mywikis.net/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AiOS_Sequence_of_Calls"/>
	<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Template:iOS_Sequence_of_Calls&amp;action=history"/>
	<updated>2026-04-17T06:13:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Template:iOS_Sequence_of_Calls&amp;diff=5188&amp;oldid=prev</id>
		<title>ColinBrown: Created page with &quot;== Sequence of Calls == === play === Call &lt;code&gt;play&lt;/code&gt; at the start of each new stream. If changing videos or watching a new video, call &lt;code&gt;play()&lt;/code&gt; each time....&quot;</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Template:iOS_Sequence_of_Calls&amp;diff=5188&amp;oldid=prev"/>
		<updated>2021-08-23T21:07:21Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Sequence of Calls == === play === Call &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; at the start of each new stream. If changing videos or watching a new video, call &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; each time....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Call &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; at the start of each new stream. If changing videos or watching a new video, call &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; each time. &lt;br /&gt;
&lt;br /&gt;
Objective C&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:()];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Swift &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
&lt;br /&gt;
Objective C &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi loadMetadata:(contentMetadata)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Swift &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
Objective C &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-(void) setPlayHeadPosition {&lt;br /&gt;
    &lt;br /&gt;
    //Setting play head position&lt;br /&gt;
    CMTime timeInterval = CMTimeMakeWithSeconds(1, 1);&lt;br /&gt;
    [player addPeriodicTimeObserverForInterval:(timeInterval) queue:dispatch_get_main_queue() usingBlock:^(CMTime time){&lt;br /&gt;
        NSTimeInterval seconds = CMTimeGetSeconds(time);&lt;br /&gt;
        NSInteger intSec = seconds;&lt;br /&gt;
        &lt;br /&gt;
        //Sending data dictionary to SDK with updated playHead position.&lt;br /&gt;
        [nielsenApi playheadPosition:(intSec)];&lt;br /&gt;
    }];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swift &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
Objective C &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Swift &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi.stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
Objective C &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Swift &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi.end()&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>ColinBrown</name></author>
	</entry>
</feed>