Seek in the current playing media.
772108
def set_position(self, pos):
        """"""
        time_in_ms = int(pos)*1000
        return self.apple_tv.set_property('dacp.playingtime', time_in_ms)
575460
def getMedia(self):
        
        server = self.server().connect()
        key = '/sync/items/%s' % self.id
        return server.fetchItems(key)
406115
def seek(self, offset, whence=0):
        """"""
        if self._offset:
            if whence == 0:
                self._fh.seek(self._offset + offset, whence)
                return
            if whence == 2 and self._size > 0:
                self._fh.seek(self._offset + self._size + offset, 0)
                return
        self._fh.seek(offset, whence)
810093
function() {
    var self = this;

    // Get the Howl we want to manipulate.
    var sound = self.playlist[self.index].howl;

    // Determine our current seek position.
    var seek = sound.seek() || 0;
    timer.innerHTML = self.formatTime(Math.round(seek));
    progress.style.width = (((seek / sound.duration()) * 100) || 0) + '%';

    // If the sound is still playing, continue stepping.
    if (sound.playing()) {
      requestAnimationFrame(self.step.bind(self));
    }
  }
135540
def is_playing_tv(self):
        """"""
        response = self.avTransport.GetPositionInfo([
            ('InstanceID', 0),
            ('Channel', 'Master')
        ])
        track_uri = response['TrackURI']
        return re.match(r'^x-sonos-htastream:', track_uri) is not None
613044
def _explore_storage(self):
        """"""
        path = ''
        dirs = [path]
        while dirs:
            path = dirs.pop()
            subdirs, files = self.media_storage.listdir(path)
            for media_filename in files:
                yield os.path.join(path, media_filename)
            dirs.extend([os.path.join(path, subdir) for subdir in subdirs])
120441
function() {
        sound._paused = false;
        sound._seek = seek;
        sound._start = start;
        sound._stop = stop;
        sound._loop = loop;
      }
1071592
async def play(self):
        
        if self.repeat and self.current is not None:
            self.queue.append(self.current)

        self.current = None
        self.position = 0
        self._paused = False

        if not self.queue:
            await self.stop()
        else:
            self._is_playing = True
            if self.shuffle:
                track = self.queue.pop(randrange(len(self.queue)))
            else:
                track = self.queue.pop(0)

            self.current = track
            log.debug("Assigned current.")
            await self.node.play(self.channel.guild.id, track)
179887
function Playback (deviceIndex, displayMode, pixelFormat) {
  this.index = 0;
  this.deviceIndex = deviceIndex;
  this.displayMode = displayMode;
  this.pixelFormat = pixelFormat;
  this.running = true;
  this.emergencyBrake = null;
  if (arguments.length !== 3 || typeof deviceIndex !== 'number' ||
      typeof displayMode !== 'number' || typeof pixelFormat !== 'number' ) {
    this.emit('error', new Error('Playback requires three number arguments: ' +
      'index, display mode and pixel format'));
  } else {
    this.playback = macadamNative.playback({
      deviceIndex: deviceIndex,
      displayMode: displayMode,
      pixelFormat: pixelFormat
    }).catch(err => { this.emit('error', err); });
    /* process.on('exit', function () {
      console.log('Exiting node.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit(0);
    }); */
    process.on('SIGINT', () => {
      console.log('Received SIGINT.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit();
    });
  }

  EventEmitter.call(this);
}
1012842
def play(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'play'
        self._response['action']['audio']['sources'] = []
        return self
240677
function restartMediaPlayer () {
        exitingSeek = false;
        pauseOnExitSeek = false;
        var source = mediaPlayer.getSource();
        var mimeType = mediaPlayer.getMimeType();

        reset();
        mediaPlayer.initialiseMedia('video', source, mimeType, playbackElement, setSourceOpts);
        mediaPlayer.beginPlaybackFrom(currentTime + timeCorrection || 0);
      }
31279
function(frame) {
                if (this.status != "playing") {
                    return;
                }
                this.time += frame.dur;
                this.setValue(this.getValue());
                if (this.time >= this.duration) {
                    this.timeUp();
                }
                frame.next();
            }
1129796
def seek(self, offset, whence=START):
        """"""
        logger.debug('seeking to offset: %r whence: %r', offset, whence)
        if whence not in WHENCE_CHOICES:
            raise ValueError('invalid whence, expected one of %r' % WHENCE_CHOICES)

        if whence == START:
            new_position = offset
        elif whence == CURRENT:
            new_position = self._current_pos + offset
        else:
            new_position = self._content_length + offset
        new_position = clamp(new_position, 0, self._content_length)
        self._current_pos = new_position
        self._raw_reader.seek(new_position)
        logger.debug('new_position: %r', self._current_pos)

        self._buffer.empty()
        self._eof = self._current_pos == self._content_length
        return self._current_pos
182597
public void play ()
    {
        if (_state == AL10.AL_PLAYING) {
            log.warning("Tried to play stream already playing.");
            return;
        }
        if (_state == AL10.AL_INITIAL) {
            _qidx = _qlen = 0;
            queueBuffers(_buffers.length);
        }
        _source.play();
        _state = AL10.AL_PLAYING;
    }
967547
public boolean play (SoundType type, String pkgPath, String key, int delay)
    {
        return play(type, pkgPath, key, delay, PAN_CENTER);
    }
341062
function _mediaMatch(object, key, value) {
  if (!{}.hasOwnProperty.call(object, key)) {
    return false;
  }
  return Boolean(object[key].indexOf(value) >= 0);
}
671303
async def playback(dev: Device, cmd, target, value):
    """"""
    if target and value:
        dev.set_playback_settings(target, value)
    if cmd == "support":
        click.echo("Supported playback functions:")
        supported = await dev.get_supported_playback_functions("storage:usb1")
        for i in supported:
            print(i)
    elif cmd == "settings":
        print_settings(await dev.get_playback_settings())
        # click.echo("Playback functions:")
        # funcs = await dev.get_available_playback_functions()
        # print(funcs)
    else:
        click.echo("Currently playing: %s" % await dev.get_play_info())