Method triggered when the iv_thumbnail widget is clicked. This method shows a toast with the
video title.
549093
@OnClick(R.id.iv_thumbnail) void onThubmnailClicked() {
    Toast.makeText(this, VIDEO_TITLE, Toast.LENGTH_SHORT).show();
  }
960314
public static void getVideoThumbnail(String videoPath, final VideoThumbnailCallback cb){
        new AsyncTask<String, Void, Bitmap>(){
            @Override
            protected Bitmap doInBackground(String... params) {
                if(params.length > 0) {
                    String path = params[0];
                    if(!TextUtils.isEmpty(path)){
                        return getVideoThumbnail(path);
                    }
                }
                return null;
            }

            @Override
            protected void onPostExecute(Bitmap bitmap) {
                cb.onThumbnail(bitmap);
            }
        }.execute(videoPath);
    }
36820
private void initAdapter() {
    RandomVideoCollectionGenerator randomVideoCollectionGenerator =
        new RandomVideoCollectionGenerator();
    final AdapteeCollection<Video> videoCollection =
        randomVideoCollectionGenerator.generateListAdapteeVideoCollection(VIDEO_COUNT);
    RendererBuilder<Video> rendererBuilder = new RendererBuilder<Video>().withPrototype(
        new RemovableVideoRenderer(new RemovableVideoRenderer.Listener() {
          @Override public void onRemoveButtonTapped(Video video) {
            ArrayList<Video> clonedList =
                new ArrayList<>((Collection<? extends Video>) videoCollection);
            clonedList.remove(video);
            adapter.diffUpdate(clonedList);
          }
        })).bind(Video.class, RemovableVideoRenderer.class);

    adapter = new RVRendererAdapter<>(rendererBuilder, videoCollection);
  }
648876
def _qteMouseClicked(self, widgetObj):
        

        # ------------------------------------------------------------
        # The following cases for widgetObj have to be distinguished:
        #   1: not part of the Qtmacs widget hierarchy
        #   2: part of the Qtmacs widget hierarchy but not registered
        #   3: registered with Qtmacs and an applet
        #   4: registered with Qtmacs and anything but an applet
        # ------------------------------------------------------------

        # Case 1: return immediately if widgetObj is not part of the
        # Qtmacs widget hierarchy; otherwise, declare the applet
        # containing the widgetObj active.
        app = qteGetAppletFromWidget(widgetObj)
        if app is None:
            return
        else:
            self._qteActiveApplet = app

        # Case 2: unregistered widgets are activated immediately.
        if not hasattr(widgetObj, '_qteAdmin'):
            self._qteActiveApplet.qteMakeWidgetActive(widgetObj)
        else:
            if app._qteAdmin.isQtmacsApplet:
                # Case 3: widgetObj is a QtmacsApplet instance; do not
                # focus any of its widgets as the focus manager will
                # take care of it.
                self._qteActiveApplet.qteMakeWidgetActive(None)
            else:
                # Case 4: widgetObj was registered with qteAddWidget
                # and can thus be focused directly.
                self._qteActiveApplet.qteMakeWidgetActive(widgetObj)

        # Trigger the focus manager.
        self._qteFocusManager()
895411
@WorkerThread
    @Nullable
    public String createThumbnailForVideo(String videoPath) {
        if (TextUtils.isEmpty(videoPath)) return null;

        File thumbnailFile = randomPath(videoPath);
        if (thumbnailFile.exists()) return thumbnailFile.getAbsolutePath();

        try {
            MediaMetadataRetriever retriever = new MediaMetadataRetriever();
            if (URLUtil.isNetworkUrl(videoPath)) {
                retriever.setDataSource(videoPath, new HashMap<String, String>());
            } else {
                retriever.setDataSource(videoPath);
            }
            Bitmap bitmap = retriever.getFrameAtTime();
            thumbnailFile.createNewFile();
            bitmap.compress(Bitmap.CompressFormat.JPEG, THUMBNAIL_QUALITY, new FileOutputStream(thumbnailFile));
            return thumbnailFile.getAbsolutePath();
        } catch (Exception ignored) {
            return null;
        }
    }
683029
function _buildVideo(videoDescriptor) {
		this.url = videoDescriptor.url;
		this.appData = videoDescriptor.appData;
		descriptor = videoDescriptor;
	}
941835
function() {
            if (!api._) {
              completion(new $.Error('The plugin went away before the stream could be bound.'));
              return;
            }

            if (api._.videoWidth > 0) {
              // This fires a little too soon.
              setTimeout(completion, 200);
            }
            else {
              setTimeout(verifyStream, 500);
            }
          }
305825
@Override
    public void onClick(View v) {
        String tag = (String) v.getTag();
        mContentTextView.setText(String.format("%s clicked.", tag));
        mMenuDrawer.setActiveView(v);
    }
36120
def imshow(self, name):
        """"""
        sw = self.shellwidget
        if sw._reading:
            sw.dbg_exec_magic('varexp', '--imshow %s' % name)
        else:
            sw.execute("%%varexp --imshow %s" % name)
894867
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WVideo videoComponent = (WVideo) component;
		XmlStringBuilder xml = renderContext.getWriter();
		Video[] video = videoComponent.getVideo();

		if (video == null || video.length == 0) {
			return;
		}

		Track[] tracks = videoComponent.getTracks();
		WVideo.Controls controls = videoComponent.getControls();
		int width = videoComponent.getWidth();
		int height = videoComponent.getHeight();
		int duration = video[0].getDuration();

		// Check for alternative text
		String alternativeText = videoComponent.getAltText();

		if (alternativeText == null) {
			LOG.warn("Video should have a description.");
			alternativeText = null;
		} else {
			alternativeText = I18nUtilities.format(null, alternativeText);
		}

		xml.appendTagOpen("ui:video");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalUrlAttribute("poster", videoComponent.getPosterUrl());
		xml.appendOptionalAttribute("alt", alternativeText);
		xml.appendOptionalAttribute("autoplay", videoComponent.isAutoplay(), "true");
		xml.appendOptionalAttribute("mediagroup", videoComponent.getMediaGroup());
		xml.appendOptionalAttribute("loop", videoComponent.isLoop(), "true");
		xml.appendOptionalAttribute("muted", videoComponent.isMuted(), "true");
		xml.appendOptionalAttribute("hidden", videoComponent.isHidden(), "true");
		xml.appendOptionalAttribute("disabled", videoComponent.isDisabled(), "true");
		xml.appendOptionalAttribute("toolTip", videoComponent.getToolTip());
		xml.appendOptionalAttribute("width", width > 0, width);
		xml.appendOptionalAttribute("height", height > 0, height);
		xml.appendOptionalAttribute("duration", duration > 0, duration);

		switch (videoComponent.getPreload()) {
			case NONE:
				xml.appendAttribute("preload", "none");
				break;

			case META_DATA:
				xml.appendAttribute("preload", "metadata");
				break;

			case AUTO:
			default:
				break;
		}

		if (controls != null && !WVideo.Controls.NATIVE.equals(controls)) {
			switch (controls) {
				case NONE:
					xml.appendAttribute("controls", "none");
					break;

				case ALL:
					xml.appendAttribute("controls", "all");
					break;

				case PLAY_PAUSE:
					xml.appendAttribute("controls", "play");
					break;

				case DEFAULT:
					xml.appendAttribute("controls", "default");
					break;

				default:
					LOG.error("Unknown control type: " + controls);
			}
		}

		xml.appendClose();

		String[] urls = videoComponent.getVideoUrls();

		for (int i = 0; i < urls.length; i++) {
			xml.appendTagOpen("ui:src");
			xml.appendUrlAttribute("uri", urls[i]);
			xml.appendOptionalAttribute("type", video[i].getMimeType());

			if (video[i].getSize() != null) {
				xml.appendOptionalAttribute("width", video[i].getSize().width > 0, video[i].
						getSize().width);
				xml.appendOptionalAttribute("height", video[i].getSize().height > 0, video[i].
						getSize().height);
			}

			xml.appendEnd();
		}

		if (tracks != null && tracks.length > 0) {
			String[] trackUrls = videoComponent.getTrackUrls();

			for (int i = 0; i < tracks.length; i++) {
				xml.appendTagOpen("ui:track");
				xml.appendUrlAttribute("src", trackUrls[i]);
				xml.appendOptionalAttribute("lang", tracks[i].getLanguage());
				xml.appendOptionalAttribute("desc", tracks[i].getDescription());
				xml.appendOptionalAttribute("kind", trackKindToString(tracks[i].getKind()));
				xml.appendEnd();
			}
		}

		xml.appendEndTag("ui:video");
	}
851498
def preview(self, obj, request=None):
        
        source = self.get_thumbnail_source(obj)
        if source:
            try:
                from easy_thumbnails.files import get_thumbnailer
            except ImportError:
                logger.warning(
                    _(
                        '`easy_thumbnails` is not installed and required for '
                        'icekit.admin_tools.mixins.ThumbnailAdminMixin'
                    )
                )
                return ''
            try:
                thumbnailer = get_thumbnailer(source)
                thumbnail = thumbnailer.get_thumbnail(self.thumbnail_options)
                return '<img class="thumbnail" src="{0}" />'.format(
                    thumbnail.url)
            except Exception as ex:
                logger.warning(
                    _(u'`easy_thumbnails` failed to generate a thumbnail image'
                      u' for {0}'.format(source)))
                if self.thumbnail_show_exceptions:
                    return 'Thumbnail exception: {0}'.format(ex)
        return ''
1283780
function videoEnterFullscreen(element) {
		var videoElement = _getVideo(element);

		if (videoElement && videoElement.webkitEnterFullscreen) {
			try {
				if (videoElement.readyState < videoElement.HAVE_METADATA) {
					videoElement.addEventListener('loadedmetadata', function onMetadataLoaded() {
						videoElement.removeEventListener('loadedmetadata', onMetadataLoaded, false);
						videoElement.webkitEnterFullscreen();
						hasControls = !!videoElement.getAttribute('controls');
					}, false);
					videoElement.load();
				}
				else {
					videoElement.webkitEnterFullscreen();
					hasControls = !!videoElement.getAttribute('controls');
				}

				lastVideoElement = videoElement;
			}
			catch (err) {
				return callOnError('not_supported', element);
			}

			return true;
		}

		return callOnError(fn.request === undefined ? 'not_supported' : 'not_enabled', element);
	}
241869
public void showLoadingAnimation(String msg) {

        removeLoadingAnimation();
        m_loadingPanel = new FlowPanel();
        m_loadingPanel.addStyleName(I_CmsLayoutBundle.INSTANCE.uploadButton().loadingPanel());
        m_loadingPanel.addStyleName(org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());

        CmsLoadingAnimation animationDiv = new CmsLoadingAnimation();
        animationDiv.addStyleName(I_CmsLayoutBundle.INSTANCE.uploadButton().loadingAnimation());
        m_loadingPanel.add(animationDiv);

        HTML messageDiv = new HTML();
        messageDiv.addStyleName(I_CmsLayoutBundle.INSTANCE.uploadButton().loadingText());
        messageDiv.setHTML(msg);
        m_loadingPanel.add(messageDiv);

        m_container.add(m_loadingPanel);
    }
722123
function(tag, options, ready){
    this.tag = tag; // Store the original tag used to set options

    // Make sure tag ID exists
    tag.id = tag.id || 'vjs_video_' + vjs.guid++;

    // Set Options
    // The options argument overrides options set in the video tag
    // which overrides globally set options.
    // This latter part coincides with the load order
    // (tag must exist before Player)
    options = vjs.obj.merge(this.getTagSettings(tag), options);

    // Cache for video property values.
    this.cache_ = {};

    // Set poster
    this.poster_ = options['poster'];
    // Set controls
    this.controls_ = options['controls'];
    // Original tag settings stored in options
    // now remove immediately so native controls don't flash.
    // May be turned back on by HTML5 tech if nativeControlsForTouch is true
    tag.controls = false;

    // we don't want the player to report touch activity on itself
    // see enableTouchActivity in Component
    options.reportTouchActivity = false;

    // Run base component initializing with new options.
    // Builds the element through createEl()
    // Inits and embeds any child components in opts
    vjs.Component.call(this, this, options, ready);

    // Update controls className. Can't do this when the controls are initially
    // set because the element doesn't exist yet.
    if (this.controls()) {
      this.addClass('vjs-controls-enabled');
    } else {
      this.addClass('vjs-controls-disabled');
    }

    // TODO: Make this smarter. Toggle user state between touching/mousing
    // using events, since devices can have both touch and mouse events.
    // if (vjs.TOUCH_ENABLED) {
    //   this.addClass('vjs-touch-enabled');
    // }

    // Firstplay event implimentation. Not sold on the event yet.
    // Could probably just check currentTime==0?
    this.one('play', function(e){
      var fpEvent = { type: 'firstplay', target: this.el_ };
      // Using vjs.trigger so we can check if default was prevented
      var keepGoing = vjs.trigger(this.el_, fpEvent);

      if (!keepGoing) {
        e.preventDefault();
        e.stopPropagation();
        e.stopImmediatePropagation();
      }
    });

    this.on('ended', this.onEnded);
    this.on('play', this.onPlay);
    this.on('firstplay', this.onFirstPlay);
    this.on('pause', this.onPause);
    this.on('progress', this.onProgress);
    this.on('durationchange', this.onDurationChange);
    this.on('error', this.onError);
    this.on('fullscreenchange', this.onFullscreenChange);

    // Make player easily findable by ID
    vjs.players[this.id_] = this;

    if (options['plugins']) {
      vjs.obj.each(options['plugins'], function(key, val){
        this[key](val);
      }, this);
    }

    this.listenForUserActivity();
  }
217165
function(content, options) {
        options = $.extend({}, this.options, options || {});

        var self = this,
            toast = this.render(options.template)
                .addClass(options.animation)
                .attr('role', 'note')
                .html(content)
                .conceal()
                .prependTo(this.wrapper);

        this.fireEvent('create', [toast]);

        // Set a timeout to trigger show transition
        setTimeout(function() {
            self.show(toast);
        }, 15); // IE needs a minimum of 15

        // Set a timeout to remove the toast
        if (options.duration) {
            setTimeout(function() {
                self.hide(toast);
            }, options.duration + 15);
        }
    }
414496
def show(self, ):
        
        wins = set(JB_MainWindow.instances())
        widgets = set(self.get_widgets())
        for w in wins - widgets:
            self.add_widget(w)
        super(JB_WindowToolTip, self).show()
50162
@OnClick(R.id.iv_fan_art) void onFanArtClicked() {
    Toast.makeText(this, tvShowSelected.getTitle(), Toast.LENGTH_LONG).show();
  }