小编Özg*_*sil的帖子

如何用静音道具取消静音html5视频

我创建了一个带静音的简单视频块(用于移动自动启动),但现在我无法改变静音状态......

我使用那个存储库,小提琴链接会很棒.

到目前为止,我已经尝试过,没有运气.

HTML

<video width="640" height="264" muted autoplay webkit-playsinline src="'+videoURL+'"></video>'
Run Code Online (Sandbox Code Playgroud)

JS

$(document).on("click",".containerVolume",function(e){
        if(isMuted){
            $('video').prop('muted', false);
        }
        else{
            $('video').prop('muted',true);
        }
});

var videos = document.querySelectorAll('video');
      if (location.search === '?enabled=false') 
      {
      } else if (location.search === '?enabled=true') {
           enableVideos(false);
      } else {
         enableVideos();
      }
      function enableVideos(everywhere) {
          for (var i = 0; i < videos.length; i++) {
             window.makeVideoPlayableInline(videos[i], !videos[i].hasAttribute('muted'), !everywhere);
          }
      }
Run Code Online (Sandbox Code Playgroud)

javascript video html5

4
推荐指数
1
解决办法
3万
查看次数

自定义TableViewCell没有故事板

我正在使用TableViewCell扩展的自定义cocoa类,它不会给出任何错误消息,但单元格不会出现在tableview中.滚动变长但表格单元格不可见.

我在我的ViewController中键入了这个:

tableView.registerClass(CustomTableViewCell.self, forCellReuseIdentifier: "Cell")

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)->UITableViewCell
    {
        var cell:CustomTableViewCell? = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as? CustomTableViewCell
        if cell == nil {
            cell = CustomTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
         }

        cell!.labTime.text = filtered[indexPath.row].name!
        return cell!
    }
Run Code Online (Sandbox Code Playgroud)

我的细胞类看起来像

    var labTime = UILabel()

    override func awakeFromNib() {
        // Initialization code
        super.awakeFromNib()

        labTime = UILabel(frame: contentView.bounds)
        labTime.font = UIFont(name:"HelveticaNeue-Bold", size: 16)

        contentView.addSubview(labTime)
    }
Run Code Online (Sandbox Code Playgroud)

我不使用任何storyBoard或xib文件.找不到解决方案,谢谢

ios swift xcode6

2
推荐指数
1
解决办法
1316
查看次数

标签 统计

html5 ×1

ios ×1

javascript ×1

swift ×1

video ×1

xcode6 ×1